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
c9e73abe
Commit
c9e73abe
authored
Nov 13, 2020
by
泽锋 李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增库存明细查询的接口
parent
5b2cc63e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
7 deletions
+56
-7
daily.cs
AutoTurnOver.DB/daily.cs
+16
-5
DailyServices.cs
AutoTurnOver.Services/DailyServices.cs
+2
-2
ApiController.cs
AutoTurnOver/Controllers/ApiController.cs
+38
-0
No files found.
AutoTurnOver.DB/daily.cs
View file @
c9e73abe
...
@@ -249,14 +249,16 @@ UNION ALL
...
@@ -249,14 +249,16 @@ UNION ALL
/// <param name="warehouse_code">仓库编码</param>
/// <param name="warehouse_code">仓库编码</param>
/// <returns></returns>
/// <returns></returns>
public
static
List
<
dc_base_stock_dto
>
RealtimeList
(
int
?
monitor_status
,
int
?
searchType
,
string
key_words
,
string
warehouse_code
,
string
supplier_name
,
int
offset
,
int
limit
,
ref
int
total
,
string
warehousetype
,
int
?
warehousearea
,
bool
isSum
=
false
,
string
order
=
null
,
string
sort
=
null
,
int
?
has_tort
=
null
,
List
<
bailun_category_new_dto
>
categoryModels
=
null
,
string
buyer_name
=
null
,
public
static
List
<
dc_base_stock_dto
>
RealtimeList
(
int
?
monitor_status
,
int
?
searchType
,
string
key_words
,
string
warehouse_code
,
string
supplier_name
,
int
offset
,
int
limit
,
ref
int
total
,
string
warehousetype
,
int
?
warehousearea
,
bool
isSum
=
false
,
string
order
=
null
,
string
sort
=
null
,
int
?
has_tort
=
null
,
List
<
bailun_category_new_dto
>
categoryModels
=
null
,
string
buyer_name
=
null
,
DateTime
?
start_date
=
null
,
DateTime
?
end_date
=
null
,
DateTime
?
f_start_date
=
null
,
DateTime
?
f_end_date
=
null
,
int
?
product_type
=
null
)
DateTime
?
start_date
=
null
,
DateTime
?
end_date
=
null
,
DateTime
?
f_start_date
=
null
,
DateTime
?
f_end_date
=
null
,
int
?
product_type
=
null
,
bool
is_warehouse_sum
=
false
)
{
{
DynamicParameters
parameters
=
new
DynamicParameters
();
DynamicParameters
parameters
=
new
DynamicParameters
();
var
sql
=
""
;
var
sql
=
""
;
if
(
isSum
)
if
(
isSum
||
is_warehouse_sum
)
{
{
sql
=
@"
sql
=
@"
select
select
t1.warehouse_code,
(dbw.warehouse_name) as warehouse_name,
sum(t1.quantity_reservation) as 'quantity_reservation',
sum(t1.quantity_reservation) as 'quantity_reservation',
sum(t1.quantity_transport) as 'quantity_transport',
sum(t1.quantity_transport) as 'quantity_transport',
sum(t1.quantity_transfer) as 'quantity_transfer',
sum(t1.quantity_transfer) as 'quantity_transfer',
...
@@ -519,14 +521,23 @@ left join dc_base_warehouse as dbw on t1.warehouse_code = dbw.warehouse_code
...
@@ -519,14 +521,23 @@ left join dc_base_warehouse as dbw on t1.warehouse_code = dbw.warehouse_code
}
}
else
else
{
{
if
(
limit
>
1000
)
if
(
is_warehouse_sum
)
{
{
total
=
0
;
if
(
limit
>
1000
)
{
total
=
0
;
}
else
{
total
=
_connection
.
QueryFirst
<
int
>(
countSql
,
parameters
,
commandTimeout
:
0
);
}
}
}
else
else
{
{
total
=
_connection
.
QueryFirst
<
int
>(
countSql
,
parameters
,
commandTimeout
:
0
);
countSql
+=
" group by t1.warehouse_code "
;
total
=
_connection
.
Query
<
int
>(
countSql
,
parameters
,
commandTimeout
:
0
).
Count
();
}
}
if
(!
string
.
IsNullOrEmpty
(
sort
)
&&
!
string
.
IsNullOrEmpty
(
order
))
if
(!
string
.
IsNullOrEmpty
(
sort
)
&&
!
string
.
IsNullOrEmpty
(
order
))
...
...
AutoTurnOver.Services/DailyServices.cs
View file @
c9e73abe
...
@@ -40,14 +40,14 @@ namespace AutoTurnOver.Services
...
@@ -40,14 +40,14 @@ namespace AutoTurnOver.Services
public
List
<
dc_base_stock_dto
>
RealtimeList
(
int
?
monitor_status
,
int
?
searchType
,
string
key_words
,
string
warehouse_code
,
string
supplier_name
,
int
offset
,
int
limit
,
ref
int
total
,
string
warehousetype
,
int
?
warehousearea
,
bool
isSum
=
false
,
string
order
=
null
,
string
sort
=
null
,
int
?
has_tort
=
null
,
string
categoryIds
=
null
,
string
buyer_name
=
null
,
public
List
<
dc_base_stock_dto
>
RealtimeList
(
int
?
monitor_status
,
int
?
searchType
,
string
key_words
,
string
warehouse_code
,
string
supplier_name
,
int
offset
,
int
limit
,
ref
int
total
,
string
warehousetype
,
int
?
warehousearea
,
bool
isSum
=
false
,
string
order
=
null
,
string
sort
=
null
,
int
?
has_tort
=
null
,
string
categoryIds
=
null
,
string
buyer_name
=
null
,
DateTime
?
start_date
=
null
,
DateTime
?
end_date
=
null
,
DateTime
?
f_start_date
=
null
,
DateTime
?
f_end_date
=
null
,
int
?
product_type
=
null
)
DateTime
?
start_date
=
null
,
DateTime
?
end_date
=
null
,
DateTime
?
f_start_date
=
null
,
DateTime
?
f_end_date
=
null
,
int
?
product_type
=
null
,
bool
is_warehouse_sum
=
false
)
{
{
List
<
bailun_category_new_dto
>
categoryModels
=
null
;
List
<
bailun_category_new_dto
>
categoryModels
=
null
;
if
(!
string
.
IsNullOrWhiteSpace
(
categoryIds
))
if
(!
string
.
IsNullOrWhiteSpace
(
categoryIds
))
{
{
categoryModels
=
ApiServices
.
GetNewClientNodesByIds
(
categoryIds
.
Split
(
','
).
Select
(
s
=>
int
.
Parse
(
s
)).
ToList
());
categoryModels
=
ApiServices
.
GetNewClientNodesByIds
(
categoryIds
.
Split
(
','
).
Select
(
s
=>
int
.
Parse
(
s
)).
ToList
());
}
}
return
DB
.
daily
.
RealtimeList
(
monitor_status
,
searchType
,
key_words
,
warehouse_code
,
supplier_name
,
offset
,
limit
,
ref
total
,
warehousetype
,
warehousearea
,
isSum
,
order
,
sort
,
has_tort
:
has_tort
,
categoryModels
:
categoryModels
,
buyer_name
:
buyer_name
,
start_date
:
start_date
,
end_date
:
end_date
,
f_start_date
:
f_start_date
,
f_end_date
:
f_end_date
,
product_type
:
product_type
);
return
DB
.
daily
.
RealtimeList
(
monitor_status
,
searchType
,
key_words
,
warehouse_code
,
supplier_name
,
offset
,
limit
,
ref
total
,
warehousetype
,
warehousearea
,
isSum
,
order
,
sort
,
has_tort
:
has_tort
,
categoryModels
:
categoryModels
,
buyer_name
:
buyer_name
,
start_date
:
start_date
,
end_date
:
end_date
,
f_start_date
:
f_start_date
,
f_end_date
:
f_end_date
,
product_type
:
product_type
,
is_warehouse_sum
);
}
}
public
List
<
dc_auto_shortage_push_route_dto
>
ShortagePushList
(
string
platform
,
string
bailun_sku
,
int
offset
,
int
limit
,
ref
int
total
,
DateTime
?
start_date
,
DateTime
?
end_date
,
string
warehousecode
,
string
warehousetype
,
int
?
warehousearea
)
public
List
<
dc_auto_shortage_push_route_dto
>
ShortagePushList
(
string
platform
,
string
bailun_sku
,
int
offset
,
int
limit
,
ref
int
total
,
DateTime
?
start_date
,
DateTime
?
end_date
,
string
warehousecode
,
string
warehousetype
,
int
?
warehousearea
)
...
...
AutoTurnOver/Controllers/ApiController.cs
View file @
c9e73abe
...
@@ -77,6 +77,44 @@ namespace AutoTurnOver.Controllers
...
@@ -77,6 +77,44 @@ namespace AutoTurnOver.Controllers
}
}
}
}
/// <summary>
/// 实时库存
/// </summary>
/// <param name="sku"></param>
/// <param name="warehousecode"></param>
/// <param name="offset"></param>
/// <param name="limit"></param>
/// <returns></returns>
[
HttpGet
(
"RealtimeStockList"
)]
public
JsonResult
RealtimeStockList
(
int
?
monitor_status
,
int
?
searchType
,
string
key_words
,
string
warehousecode
,
string
buyer_name
,
string
supplier_name
,
int
offset
,
int
limit
,
string
order
,
string
sort
,
string
warehousetype
,
int
?
warehousearea
,
int
?
has_tort
=
null
,
string
categoryIds
=
null
,
DateTime
?
start_date
=
null
,
DateTime
?
end_date
=
null
,
DateTime
?
f_start_date
=
null
,
DateTime
?
f_end_date
=
null
,
int
?
product_type
=
null
,
bool
is_warehouse_sum
=
false
)
{
try
{
var
services
=
new
DailyServices
();
var
total
=
0
;
var
list
=
services
.
RealtimeList
(
monitor_status
,
searchType
,
key_words
,
warehousecode
,
supplier_name
,
offset
,
limit
,
ref
total
,
warehousetype
,
warehousearea
,
order
:
order
,
sort
:
sort
,
has_tort
:
has_tort
,
categoryIds
:
categoryIds
,
buyer_name
:
buyer_name
,
start_date
:
start_date
,
end_date
:
end_date
,
f_start_date
:
f_start_date
,
f_end_date
:
f_end_date
,
product_type
:
product_type
,
is_warehouse_sum
:
is_warehouse_sum
);
return
new
JsonResult
(
new
{
rows
=
list
,
total
=
total
,
});
}
catch
(
Exception
ex
)
{
return
new
JsonResult
(
new
{
message
=
ex
.
Message
,
stack_trace
=
ex
.
StackTrace
});
}
}
public
class
GetSkus_dto
public
class
GetSkus_dto
{
{
public
string
skus
{
get
;
set
;
}
public
string
skus
{
get
;
set
;
}
...
...
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