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
9d5d2ce0
Commit
9d5d2ce0
authored
Feb 25, 2021
by
泽锋 李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
7a194d64
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
25 deletions
+70
-25
dc_auto_turnover.cs
AutoTurnOver.DB/dc_auto_turnover.cs
+63
-18
dc_base_transfer_freight_dao.cs
AutoTurnOver.DB/dc_base_transfer_freight_dao.cs
+1
-1
ResetOutofstockBackgrounService.cs
ResetOutofstock/ResetOutofstockBackgrounService.cs
+6
-6
No files found.
AutoTurnOver.DB/dc_auto_turnover.cs
View file @
9d5d2ce0
...
...
@@ -1197,7 +1197,7 @@ from dc_auto_turnover_air where gmt_modified>=@btime and gmt_modified<=@etime
new
transfer_profit_dto
{
name
=
"实际建议周转数"
,
days
=
new
List
<
transfer_profit_dto
.
day_dto
>()},
new
transfer_profit_dto
{
name
=
"实际建议周转金额"
,
days
=
new
List
<
transfer_profit_dto
.
day_dto
>()},
new
transfer_profit_dto
{
name
=
"实际周转数"
,
days
=
new
List
<
transfer_profit_dto
.
day_dto
>()},
new
transfer_profit_dto
{
name
=
"实际周转运费"
,
days
=
new
List
<
transfer_profit_dto
.
day_dto
>()},
new
transfer_profit_dto
{
name
=
"实际周转
建议
运费"
,
days
=
new
List
<
transfer_profit_dto
.
day_dto
>()},
new
transfer_profit_dto
{
name
=
"实际运费单价"
,
days
=
new
List
<
transfer_profit_dto
.
day_dto
>()},
new
transfer_profit_dto
{
name
=
"海运周转数(推荐海运)"
,
days
=
new
List
<
transfer_profit_dto
.
day_dto
>()},
new
transfer_profit_dto
{
name
=
"海运周转金额"
,
days
=
new
List
<
transfer_profit_dto
.
day_dto
>()},
...
...
@@ -1285,12 +1285,33 @@ from dc_auto_turnover_air where gmt_modified>=@btime and gmt_modified<=@etime
date
=
this_time
,
val
=
modalData
.
quantity_final_advise
});
modalData
.
quantity_final_advise_amount
=
dc_base_sku_data
.
unit_price
;
modalData
.
quantity_final_advise_amount
=
Math
.
Round
(
modalData
.
quantity_final_advise
*
modalData
.
unit_price
??
0
,
2
)
;
datas
.
FirstOrDefault
(
s
=>
s
.
name
==
"实际建议周转金额"
).
days
.
Add
(
new
transfer_profit_dto
.
day_dto
{
date
=
this_time
,
val
=
modalData
.
quantity_final_advise
*
modalData
.
unit_price
val
=
modalData
.
quantity_final_advise_amount
});
if
(
this_time
.
ToString
(
"MM-dd"
)==
"02-25"
)
{
}
modalData
.
freight_unit_price
=
_connection
.
QueryFirstOrDefault
<
decimal
?>(
" select freight_unit_price from dc_base_transfer_freight where warehouse_code=@warehouse_code and bailun_sku=@bailun_sku limit 1 "
,
new
{
warehouse_code
=
result
.
warehouse_code
,
bailun_sku
=
result
.
bailun_sku
});
datas
.
FirstOrDefault
(
s
=>
s
.
name
==
"实际运费单价"
).
days
.
Add
(
new
transfer_profit_dto
.
day_dto
{
date
=
this_time
,
val
=
modalData
.
freight_unit_price
});
modalData
.
freight_price
=
modalData
.
freight_unit_price
*
modalData
.
purchase_quantity
;
datas
.
FirstOrDefault
(
s
=>
s
.
name
==
"实际周转建议运费"
).
days
.
Add
(
new
transfer_profit_dto
.
day_dto
{
date
=
this_time
,
val
=
modalData
.
freight_price
});
modalData
.
quantity_final_advise_ocean
=
(
advised_details_ocean
.
Count
-
1
<
index
?
0
:
advised_details_ocean
[
index
]);
datas
.
FirstOrDefault
(
s
=>
s
.
name
==
"海运周转数(推荐海运)"
).
days
.
Add
(
new
transfer_profit_dto
.
day_dto
...
...
@@ -1298,13 +1319,13 @@ from dc_auto_turnover_air where gmt_modified>=@btime and gmt_modified<=@etime
date
=
this_time
,
val
=
modalData
.
quantity_final_advise_ocean
});
modalData
.
quantity_final_advise_ocean_amount
=
modalData
.
quantity_final_advise_ocean
*
modalData
.
unit_price
;
modalData
.
quantity_final_advise_ocean_amount
=
Math
.
Round
(
modalData
.
quantity_final_advise_ocean
*
modalData
.
unit_price
??
0
,
2
)
;
datas
.
FirstOrDefault
(
s
=>
s
.
name
==
"海运周转金额"
).
days
.
Add
(
new
transfer_profit_dto
.
day_dto
{
date
=
this_time
,
val
=
modalData
.
quantity_final_advise_ocean_amount
});
modalData
.
freight_price_ocean
=
modalData
.
quantity_final_advise_ocean
*
modalData
.
freight_unit_price_ocean
;
modalData
.
freight_price_ocean
=
Math
.
Round
(
modalData
.
quantity_final_advise_ocean
??
0
*
modalData
.
freight_unit_price_ocean
,
2
)
;
datas
.
FirstOrDefault
(
s
=>
s
.
name
==
"海运周转运费"
).
days
.
Add
(
new
transfer_profit_dto
.
day_dto
{
date
=
this_time
,
...
...
@@ -1317,13 +1338,13 @@ from dc_auto_turnover_air where gmt_modified>=@btime and gmt_modified<=@etime
date
=
this_time
,
val
=
modalData
.
quantity_final_advise_air
});
modalData
.
quantity_final_advise_air_amount
=
modalData
.
quantity_final_advise_air
*
modalData
.
unit_price
;
modalData
.
quantity_final_advise_air_amount
=
Math
.
Round
(
modalData
.
quantity_final_advise_air
*
modalData
.
unit_price
??
0
,
2
)
;
datas
.
FirstOrDefault
(
s
=>
s
.
name
==
"空运周转金额"
).
days
.
Add
(
new
transfer_profit_dto
.
day_dto
{
date
=
this_time
,
val
=
modalData
.
quantity_final_advise_air_amount
});
modalData
.
freight_price_air
=
modalData
.
quantity_final_advise_air
*
modalData
.
freight_unit_price_air
;
modalData
.
freight_price_air
=
Math
.
Round
(
modalData
.
quantity_final_advise_air
*
modalData
.
freight_unit_price_air
??
0
,
2
)
;
datas
.
FirstOrDefault
(
s
=>
s
.
name
==
"空运周转运费"
).
days
.
Add
(
new
transfer_profit_dto
.
day_dto
{
date
=
this_time
,
...
...
@@ -1419,7 +1440,7 @@ from dc_auto_turnover_air where gmt_modified>=@btime and gmt_modified<=@etime
val
=
modalData
.
freight_unit_price
});
modalData
.
freight_price
=
modalData
.
freight_unit_price
*
modalData
.
purchase_quantity
;
datas
.
FirstOrDefault
(
s
=>
s
.
name
==
"实际周转运费"
).
days
.
Add
(
new
transfer_profit_dto
.
day_dto
datas
.
FirstOrDefault
(
s
=>
s
.
name
==
"实际周转
建议
运费"
).
days
.
Add
(
new
transfer_profit_dto
.
day_dto
{
date
=
this_time
,
val
=
modalData
.
freight_price
...
...
@@ -1478,13 +1499,6 @@ from dc_auto_turnover_air where gmt_modified>=@btime and gmt_modified<=@etime
date
=
this_time
,
val
=
modalData
.
freight_price_ocean_difference_amount
});
#
endregion
}
modalData
.
quantity_final_ocean_difference_amount
=
modalData
.
quantity_final_advise_amount
-
modalData
.
quantity_final_advise_ocean_amount
;
datas
.
FirstOrDefault
(
s
=>
s
.
name
==
"实际-海运周转采购金额差值"
).
days
.
Add
(
new
transfer_profit_dto
.
day_dto
{
...
...
@@ -1495,9 +1509,35 @@ from dc_auto_turnover_air where gmt_modified>=@btime and gmt_modified<=@etime
datas
.
FirstOrDefault
(
s
=>
s
.
name
==
"差值(海运)-实际周转采购金额占比"
).
days
.
Add
(
new
transfer_profit_dto
.
day_dto
{
date
=
this_time
,
val
=
modalData
.
quantity_final_advise_amount
<=
0
?
0
M
:
(
modalData
.
quantity_final_ocean_difference_amount
/
modalData
.
quantity_final_advise_amount
)
val
=
(
modalData
.
quantity_final_advise_amount
??
0
)
<=
0
?
0
M
:
(
Math
.
Round
(
modalData
.
quantity_final_ocean_difference_amount
??
0
/
modalData
.
quantity_final_advise_amount
.
Value
,
3
))
});
modalData
.
freight_price_air_difference_amount
=
modalData
.
freight_price
-
modalData
.
freight_price_air
;
datas
.
FirstOrDefault
(
s
=>
s
.
name
==
"实际-空运运费差值"
).
days
.
Add
(
new
transfer_profit_dto
.
day_dto
{
date
=
this_time
,
val
=
modalData
.
freight_price_air_difference_amount
});
modalData
.
quantity_final_air_difference_amount
=
modalData
.
quantity_final_advise_amount
-
modalData
.
quantity_final_advise_air_amount
;
datas
.
FirstOrDefault
(
s
=>
s
.
name
==
"实际-空运周转采购金额差值"
).
days
.
Add
(
new
transfer_profit_dto
.
day_dto
{
date
=
this_time
,
val
=
modalData
.
quantity_final_air_difference_amount
});
datas
.
FirstOrDefault
(
s
=>
s
.
name
==
"差值(空运)-实际周转采购金额占比"
).
days
.
Add
(
new
transfer_profit_dto
.
day_dto
{
date
=
this_time
,
val
=
(
modalData
.
quantity_final_advise_amount
??
0
)
<=
0
?
0
M
:
(
Math
.
Round
(
modalData
.
quantity_final_air_difference_amount
??
0
/
modalData
.
quantity_final_advise_amount
.
Value
,
3
))
});
#
endregion
}
modalData
.
freight_price_ocean_air_difference
=
modalData
.
freight_price_ocean
-
modalData
.
freight_price_air
;
datas
.
FirstOrDefault
(
s
=>
s
.
name
==
"海运-空运运费差值"
).
days
.
Add
(
new
transfer_profit_dto
.
day_dto
{
...
...
@@ -1515,7 +1555,7 @@ from dc_auto_turnover_air where gmt_modified>=@btime and gmt_modified<=@etime
datas
.
FirstOrDefault
(
s
=>
s
.
name
==
"差值(海运-空运)-实际周转采购金额占比"
).
days
.
Add
(
new
transfer_profit_dto
.
day_dto
{
date
=
this_time
,
val
=
modalData
.
quantity_final_advise_amount
<=
0
?
0
M
:
(
modalData
.
quantity_final__ocean_air_difference_amount
/
modalData
.
quantity_final_advise_amount
)
val
=
(
modalData
.
quantity_final_advise_amount
??
0
)
<=
0
?
0
M
:
(
Math
.
Round
(
modalData
.
quantity_final__ocean_air_difference_amount
??
0
/
modalData
.
quantity_final_advise_amount
.
Value
,
3
)
)
});
...
...
@@ -1550,7 +1590,7 @@ from dc_auto_turnover_air where gmt_modified>=@btime and gmt_modified<=@etime
internal
decimal
?
freight_unit_price
;
/// <summary>
/// 实际周转运费
/// 实际周转
建议
运费
/// </summary>
internal
decimal
?
freight_price
;
/// <summary>
...
...
@@ -1622,6 +1662,11 @@ from dc_auto_turnover_air where gmt_modified>=@btime and gmt_modified<=@etime
internal
decimal
?
quantity_final__ocean_air_difference_amount
;
/// <summary>
/// 实际-空运运费差值
/// </summary>
internal
decimal
?
freight_price_air_difference_amount
;
/// <summary>
/// 采购单价
/// </summary>
public
decimal
?
unit_price
{
get
;
set
;
}
...
...
AutoTurnOver.DB/dc_base_transfer_freight_dao.cs
View file @
9d5d2ce0
...
...
@@ -187,7 +187,7 @@ where t2.sku=@sku and t1.targetwareno=@targetwareno and t1.estimatedcost>0 and t
//查询所有没有记录的数据
var
datas
=
_connection
.
Query
<
stock_dto
>(
@"select t1.bailun_sku,t1.warehouse_code,t1.usable_stock from dc_base_stock as t1
left join dc_base_warehouse as t2 on t1.warehouse_code = t2.warehouse_code
where t2.hq_type!='国内仓'
and t1.usable_stock>0
"
).
ToList
();
where t2.hq_type!='国内仓' "
).
ToList
();
foreach
(
var
log_data
in
datas
)
{
try
...
...
ResetOutofstock/ResetOutofstockBackgrounService.cs
View file @
9d5d2ce0
...
...
@@ -15,12 +15,12 @@ namespace ResetOutofstock
protected
override
Task
ExecuteAsync
(
CancellationToken
stoppingToken
)
{
//
Task.Factory.StartNew(() =>
//
{
//
Console.WriteLine($"init 开始 ,线程Id:{Thread.CurrentThread.ManagedThreadId},{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
//
dc_base_transfer_freight_dao.Init();
//
Console.WriteLine($"init 结束,线程Id:{Thread.CurrentThread.ManagedThreadId},{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
//
});
Task
.
Factory
.
StartNew
(()
=>
{
Console
.
WriteLine
(
$"init 开始 ,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
dc_base_transfer_freight_dao
.
Init
();
Console
.
WriteLine
(
$"init 结束,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
});
...
...
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