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
98b9dadb
Commit
98b9dadb
authored
Feb 03, 2021
by
泽锋 李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
6fa7d598
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
97 additions
and
1 deletion
+97
-1
dc_auto_turnover.cs
AutoTurnOver.DB/dc_auto_turnover.cs
+32
-0
dc_base_order_data_source.cs
AutoTurnOver.Models/dc_base_order_data_source.cs
+25
-0
Program.cs
AutoTurnOver.Purchase.AverageTarget/Program.cs
+1
-1
PurchaseAverageTargetServices.cs
AutoTurnOver.Services/PurchaseAverageTargetServices.cs
+0
-0
SkuAutoTurnServices.cs
AutoTurnOver.Services/SkuAutoTurnServices.cs
+5
-0
SkuAutoTurnController.cs
AutoTurnOver/Controllers/SkuAutoTurnController.cs
+34
-0
No files found.
AutoTurnOver.DB/dc_auto_turnover.cs
View file @
98b9dadb
...
...
@@ -1022,6 +1022,38 @@ from dc_auto_turnover where gmt_modified>=@btime and gmt_modified<=@etime
)
"
,
new
{
btime
=
DateTime
.
Now
.
ToDayHome
(),
etime
=
DateTime
.
Now
.
ToDayEnd
()
});
}
/// <summary>
/// 获取数据来源
/// </summary>
/// <returns></returns>
public
static
List
<
dc_base_order_data_source
>
GetOrderDataSource
(
dc_base_order_data_source_search_dto
searchData
,
int
offset
,
int
limit
,
ref
int
total
)
{
var
sql
=
" select * from dc_base_order_data_source as t1 where 1=1 "
;
var
countSql
=
" select count(1) from dc_base_order_data_source as t1 where 1=1 "
;
DynamicParameters
parameters
=
new
DynamicParameters
();
if
(!
string
.
IsNullOrWhiteSpace
(
searchData
.
bailun_sku
))
{
sql
+=
" and t1.bailun_sku=@bailun_sku "
;
countSql
+=
" and t1.bailun_sku=@bailun_sku "
;
parameters
.
Add
(
"bailun_sku"
,
searchData
.
bailun_sku
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
searchData
.
warehouse_code
))
{
sql
+=
" and t1.warehouse_code=@warehouse_code "
;
countSql
+=
" and t1.warehouse_code=@warehouse_code "
;
parameters
.
Add
(
"warehouse_code"
,
searchData
.
warehouse_code
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
searchData
.
order_type_str
))
{
sql
+=
" and t1.order_type=@order_type "
;
countSql
+=
" and t1.order_type=@order_type "
;
parameters
.
Add
(
"order_type"
,
searchData
.
order_type_str
);
}
sql
+=
" limit "
+
offset
+
","
+
limit
;
total
=
_connection
.
QueryFirstOrDefault
<
int
>(
countSql
,
parameters
);
return
_connection
.
Query
<
dc_base_order_data_source
>(
sql
,
parameters
).
AsList
();
}
}
...
...
AutoTurnOver.Models/dc_base_order_data_source.cs
View file @
98b9dadb
...
...
@@ -20,4 +20,29 @@ namespace AutoTurnOver.Models
public
string
logistics_name
{
get
;
set
;
}
public
string
transport_type
{
get
;
set
;
}
}
public
class
dc_base_order_data_source_search_dto
{
public
int
order_type
{
get
;
set
;
}
public
string
order_type_str
{
get
{
if
(
order_type
==
11
)
{
return
"采购单-签收天数计算"
;
}
else
if
(
order_type
==
12
)
{
return
"采购单-质检入库天数计算"
;
}
else
if
(
order_type
==
2
)
{
return
"调拨单-平均天数计算"
;
}
else
{
return
""
;
}
}
}
public
string
bailun_sku
{
get
;
set
;
}
public
string
warehouse_code
{
get
;
set
;
}
}
}
AutoTurnOver.Purchase.AverageTarget/Program.cs
View file @
98b9dadb
...
...
@@ -31,7 +31,7 @@ namespace AutoTurnOver.Purchase.AverageTarget
//PurchaseAverageTargetServices.CalculationTransfer();
//report.ResetTransExpectArrivaltime();
//dc_auto_return_goods_config_dao.NewCalculation();
//PurchaseAverageTargetServices.CalculationTransfer(
days: 18
0);
//PurchaseAverageTargetServices.CalculationTransfer(
"948890401", days: 36
0);
}
catch
(
Exception
ex
)
{
...
...
AutoTurnOver.Services/PurchaseAverageTargetServices.cs
View file @
98b9dadb
This diff is collapsed.
Click to expand it.
AutoTurnOver.Services/SkuAutoTurnServices.cs
View file @
98b9dadb
...
...
@@ -31,6 +31,11 @@ namespace AutoTurnOver.Services
m
.
categoryModels
=
ApiServices
.
GetNewClientNodesByIds
(
m
.
categoryIds
.
Split
(
','
).
Select
(
s
=>
int
.
Parse
(
s
)).
ToList
());
}
return
DB
.
dc_auto_turnover
.
List
(
m
,
offset
,
limit
,
ref
total
,
order
,
sort
,
isSum
);
}
public
List
<
dc_base_order_data_source
>
GetOrderDataSource
(
dc_base_order_data_source_search_dto
m
,
int
offset
,
int
limit
,
ref
int
total
)
{
return
DB
.
dc_auto_turnover
.
GetOrderDataSource
(
m
,
offset
,
limit
,
ref
total
);
}
public
IEnumerable
<
string
>
GetLabelList
()
{
...
...
AutoTurnOver/Controllers/SkuAutoTurnController.cs
View file @
98b9dadb
...
...
@@ -56,6 +56,40 @@ namespace AutoTurnOver.Controllers
}
}
/// <summary>
/// 查看平均数的数据来源
/// </summary>
/// <param name="m"></param>
/// <param name="offset"></param>
/// <param name="limit"></param>
/// <returns></returns>
public
JsonResult
GetOrderDataSource
([
FromQuery
]
dc_base_order_data_source_search_dto
m
,
[
FromQuery
]
int
offset
,
[
FromQuery
]
int
limit
)
{
try
{
var
total
=
0
;
var
service
=
new
Services
.
SkuAutoTurnServices
();
var
list
=
service
.
GetOrderDataSource
(
m
,
offset
,
limit
,
ref
total
);
return
new
JsonResult
(
new
{
rows
=
list
,
total
=
total
,
pagecount
=
(
total
/
limit
+
(
total
%
limit
>
0
?
1
:
0
))
});
}
catch
(
Exception
ex
)
{
return
new
JsonResult
(
new
{
message
=
ex
.
Message
,
stack_trace
=
ex
.
StackTrace
});
}
}
public
JsonResult
GetLabelList
()
{
...
...
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