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
e877aeaa
Commit
e877aeaa
authored
Aug 30, 2021
by
zhoujinhui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
up
parent
1bf81470
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
11 deletions
+13
-11
dc_auto_week_redundancy_details_dao.cs
AutoTurnOver.DB/dc_auto_week_redundancy_details_dao.cs
+3
-3
WeeklyStatisticsServices.cs
AutoTurnOver.Services/WeeklyStatisticsServices.cs
+6
-4
WeeklyStatisticsController.cs
AutoTurnOver/Controllers/WeeklyStatisticsController.cs
+4
-4
No files found.
AutoTurnOver.DB/dc_auto_week_redundancy_details_dao.cs
View file @
e877aeaa
...
@@ -101,10 +101,10 @@ namespace AutoTurnOver.DB
...
@@ -101,10 +101,10 @@ namespace AutoTurnOver.DB
/// <param name="limit"></param>
/// <param name="limit"></param>
/// <param name="total"></param>
/// <param name="total"></param>
/// <returns></returns>
/// <returns></returns>
public
static
List
<
SkuRedundancyBaseStockDto
>
GetSkuRedundancyBaseStockPageList
(
int
offset
,
int
limit
,
ref
int
total
)
public
static
List
<
SkuRedundancyBaseStockDto
>
GetSkuRedundancyBaseStockPageList
(
DateTime
startTime
,
DateTime
endtime
,
int
offset
,
int
limit
,
ref
int
total
)
{
{
StringBuilder
sql
=
new
StringBuilder
();
StringBuilder
sql
=
new
StringBuilder
();
sql
.
Append
(
@"
sql
.
Append
(
$
@"
SELECT t1.usable_stock + t1.occupy_stock as sum_usable_stock,
SELECT t1.usable_stock + t1.occupy_stock as sum_usable_stock,
((t1.usable_stock + t1.occupy_stock)*t3.unit_price) AS total_inventory_amount,
((t1.usable_stock + t1.occupy_stock)*t3.unit_price) AS total_inventory_amount,
t3.unit_price,
t3.unit_price,
...
@@ -112,7 +112,7 @@ namespace AutoTurnOver.DB
...
@@ -112,7 +112,7 @@ namespace AutoTurnOver.DB
FROM dc_base_stock AS t1
FROM dc_base_stock AS t1
LEFT JOIN dc_base_warehouse AS t2 ON t2.warehouse_code = t1.warehouse_code
LEFT JOIN dc_base_warehouse AS t2 ON t2.warehouse_code = t1.warehouse_code
LEFT JOIN dc_base_sku AS t3 ON t3.bailun_sku = t1.bailun_sku
LEFT JOIN dc_base_sku AS t3 ON t3.bailun_sku = t1.bailun_sku
WHERE 1=1 ORDER BY t1.Id DESC
WHERE 1=1
AND t1.gmt_create>='
{
startTime
}
' AND t1.gmt_create<'
{
endtime
}
'
ORDER BY t1.Id DESC
"
);
"
);
try
try
{
{
...
...
AutoTurnOver.Services/WeeklyStatisticsServices.cs
View file @
e877aeaa
...
@@ -95,10 +95,12 @@ namespace AutoTurnOver.Services
...
@@ -95,10 +95,12 @@ namespace AutoTurnOver.Services
{
{
int
limit
=
20
;
int
limit
=
20
;
int
total
=
0
;
int
total
=
0
;
for
(
int
i
=
1
;
i
<
100
;
i
++)
DateTime
startTime
=
DateHelper
.
GetWeekFirstDayMon
(
DateTime
.
Now
.
AddDays
(-
1
));
DateTime
endtime
=
DateHelper
.
GetWeekLastDaySun
(
DateTime
.
Now
.
AddDays
(-
1
)).
AddDays
(
1
).
AddMilliseconds
(-
1
);
for
(
int
i
=
1
;
i
<
10000
;
i
++)
{
{
int
offset
=
(
i
-
1
)
*
limit
;
int
offset
=
(
i
-
1
)
*
limit
;
var
dataList
=
dc_auto_week_redundancy_details_dao
.
GetSkuRedundancyBaseStockPageList
(
offset
,
limit
,
ref
total
);
var
dataList
=
dc_auto_week_redundancy_details_dao
.
GetSkuRedundancyBaseStockPageList
(
startTime
,
endtime
,
offset
,
limit
,
ref
total
);
if
(
dataList
.
Count
<=
0
)
break
;
if
(
dataList
.
Count
<=
0
)
break
;
foreach
(
var
item
in
dataList
)
foreach
(
var
item
in
dataList
)
{
{
...
@@ -111,8 +113,8 @@ namespace AutoTurnOver.Services
...
@@ -111,8 +113,8 @@ namespace AutoTurnOver.Services
total_inventory
=
item
.
sum_usable_stock
,
total_inventory
=
item
.
sum_usable_stock
,
warehouse_code
=
item
.
warehouse_code
,
warehouse_code
=
item
.
warehouse_code
,
create_date_time
=
DateTime
.
Now
,
create_date_time
=
DateTime
.
Now
,
start_date
=
DateHelper
.
GetWeekFirstDayMon
(
DateTime
.
Now
.
AddDays
(-
1
))
,
start_date
=
startTime
,
end_date
=
DateHelper
.
GetWeekLastDaySun
(
DateTime
.
Now
.
AddDays
(-
1
))
end_date
=
endtime
};
};
dc_auto_week_redundancy_details_dao
.
Insert
(
model
);
dc_auto_week_redundancy_details_dao
.
Insert
(
model
);
Console
.
WriteLine
(
$"写入库存冗余数据:
{
i
}
---
{
item
.
bailun_sku
}
"
);
Console
.
WriteLine
(
$"写入库存冗余数据:
{
i
}
---
{
item
.
bailun_sku
}
"
);
...
...
AutoTurnOver/Controllers/WeeklyStatisticsController.cs
View file @
e877aeaa
...
@@ -58,7 +58,7 @@ namespace AutoTurnOver.Controllers
...
@@ -58,7 +58,7 @@ namespace AutoTurnOver.Controllers
DataTable
table
=
new
DataTable
();
DataTable
table
=
new
DataTable
();
string
[]
cols
=
new
string
[]
{
string
[]
cols
=
new
string
[]
{
"商品编码"
,
"SKU"
,
"名称"
,
"周销量"
,
"周gmv"
,
"周退款数"
,
"周退款金额"
,
"利润率"
,
"利润额"
,
"退款率"
,
"起始日期"
,
"结束日期"
,
"创建时间"
"商品编码"
,
"SKU"
,
"名称"
,
"周销量"
,
"周gmv"
,
"周成本"
,
"周退款数"
,
"周退款金额"
,
"利润率"
,
"利润额"
,
"退款率"
,
"起始日期"
,
"结束日期"
,
"创建时间"
};
};
foreach
(
var
item
in
cols
)
foreach
(
var
item
in
cols
)
{
{
...
@@ -213,7 +213,7 @@ namespace AutoTurnOver.Controllers
...
@@ -213,7 +213,7 @@ namespace AutoTurnOver.Controllers
DataTable
table
=
new
DataTable
();
DataTable
table
=
new
DataTable
();
string
[]
cols
=
new
string
[]
{
string
[]
cols
=
new
string
[]
{
"商品编码"
,
"SKU"
,
"仓库编码"
,
"仓库名称"
,
"入库时间"
,
"历史采购数量"
,
"历史销售数量"
,
"过去7天日均"
,
"缺货时间"
,
"pds开发竞品item"
,
"商品编码"
,
"SKU"
,
"仓库编码"
,
"仓库名称"
,
"入库时间"
,
"历史采购数量"
,
"历史销售数量"
,
"过去7天日均"
,
"缺货时间"
,
"pds开发竞品item"
,
"ana市场模糊7日均"
,
"第一销售平台7日均"
,
"第二销售平台7日均"
,
"安全库存"
,
"
起始日期"
,
"结束日期"
,
"
创建时间"
"ana市场模糊7日均"
,
"第一销售平台7日均"
,
"第二销售平台7日均"
,
"安全库存"
,
"创建时间"
};
};
foreach
(
var
item
in
cols
)
foreach
(
var
item
in
cols
)
{
{
...
@@ -238,8 +238,8 @@ namespace AutoTurnOver.Controllers
...
@@ -238,8 +238,8 @@ namespace AutoTurnOver.Controllers
row
[
"第一销售平台7日均"
]
=
itemData
.
first_sales_platform_average
;
row
[
"第一销售平台7日均"
]
=
itemData
.
first_sales_platform_average
;
row
[
"第二销售平台7日均"
]
=
itemData
.
second_sales_platform_average
;
row
[
"第二销售平台7日均"
]
=
itemData
.
second_sales_platform_average
;
row
[
"安全库存"
]
=
itemData
.
safety_stock
;
row
[
"安全库存"
]
=
itemData
.
safety_stock
;
row
[
"起始日期"
]
=
itemData
.
start_date
;
//
row["起始日期"] = itemData.start_date;
row
[
"结束日期"
]
=
itemData
.
end_date
;
//
row["结束日期"] = itemData.end_date;
row
[
"创建时间"
]
=
itemData
.
create_date_time
;
row
[
"创建时间"
]
=
itemData
.
create_date_time
;
table
.
Rows
.
Add
(
row
);
table
.
Rows
.
Add
(
row
);
}
}
...
...
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