Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DataCenter_Core2.1_20190520
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
DataCenter_Core2.1_20190520
Commits
e5e79865
Commit
e5e79865
authored
Jan 03, 2021
by
guanzhenshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整逻辑仓库sku明细,增加汇总列
parent
1f3b5a09
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
230 additions
and
23 deletions
+230
-23
WareHouseServices.cs
Bailun.DC.Services/WareHouseServices.cs
+150
-0
WarehouseController.cs
...n.DC.Web/Areas/Reports/Controllers/WarehouseController.cs
+39
-2
ListWareHouseSku.cshtml
...Web/Areas/Reports/Views/Warehouse/ListWareHouseSku.cshtml
+41
-21
No files found.
Bailun.DC.Services/WareHouseServices.cs
View file @
e5e79865
...
...
@@ -371,6 +371,156 @@ namespace Bailun.DC.Services
}
/// <summary>
/// Sku仓库列表
/// </summary>
/// <param name="parameter">分页信息</param>
/// <param name="code">仓库编码</param>
/// <param name="categoryid">分类id</param>
/// <param name="minordercount">14日均销量 min值</param>
/// <param name="maxordercount">14日均销量 max值</param>
/// <param name="stockmin">库存 min值</param>
/// <param name="stockmax">库存 max值</param>
/// <param name="stockamountmin">库存金额 min值</param>
/// <param name="stockamountmax">库存金额 max值</param>
/// <param name="total">符合条件的总记录数</param>
/// <param name="onedaysalescount">昨日销量,0:0销量,1:0-1销量,2:1-5销量,5:5-10销量,10:大于10的销量</param>
/// <returns></returns>
public
Models
.
Stock
.
mSkuWarehouse
ListWareHouseSkuCount
(
string
warehousecode
,
int
?
categoryid
,
int
?
minordercount
,
int
?
maxordercount
,
int
?
stockmin
,
int
?
stockmax
,
decimal
?
stockamountmin
,
decimal
?
stockamountmax
,
string
skucategoryids
,
int
?
push_status
,
int
?
available_days_start
,
int
?
available_days_end
,
int
?
onedaysalescount
=
null
)
{
var
sqlparam
=
new
DynamicParameters
();
//available_days
var
sql
=
@"select sum(t1.amount_onedaysale) as amount_onedaysale,sum(t1.amount_stock) as amount_stock,sum(t1.amount_transit) as amount_transit,sum(t1.noshippingcount) as noshippingcount,sum(nostockcount) as nostockcount,sum(oneday_total_sales) oneday_total_sales,sum(purchase_amount) purchase_amount,sum(quantity_purchase) quantity_purchase,sum(quantity_transfer) quantity_transfer,sum(sevenday_total_sales) sevenday_total_sales,sum(thirtyday_total_sales) thirtyday_total_sales,sum(usable_stock) usable_stock,sum(quantity_tuneout_onway) quantity_tuneout_onway,sum(quantity_tuneout_30days) quantity_tuneout_30days,sum(quantity_tunein_30days) quantity_tunein_30days,sum(fourteenday_total_sales) fourteenday_total_sales,sum(cash_in_30days) cash_in_30days,sum(cash_out_30days) cash_out_30days,sum(cash_net) cash_net,sum(pin_rate_stock) pin_rate_stock,sum(amount_tunein_30days) amount_tunein_30days,sum(amount_tuneout_30days) amount_tuneout_30days,sum(sevenday_total_sales_amount) sevenday_total_sales_amount,sum(fourteenday_total_sales_amount) fourteenday_total_sales_amount,sum(thirtyday_total_sales_amount) thirtyday_total_sales_amount "
;
var
sqlwhere
=
@" from dc_skuwarehouse_stock_sales t1
left join dc_base_sku t2 on t1.bailun_sku = t2.bailun_sku
"
;
if
(!
string
.
IsNullOrWhiteSpace
(
skucategoryids
))
{
//sqlwhere += " join dc_base_sku t4 on t1.bailun_sku=t4.bailun_sku ";
var
arr
=
skucategoryids
.
Split
(
'|'
).
Where
(
a
=>
!
string
.
IsNullOrEmpty
(
a
)).
ToList
();
if
(
arr
.
Count
>
0
)
{
//获取选中分类下所有的分类
var
AllCategory
=
Services
.
CommonServices
.
GetCategoryList
(
0
);
var
listcategory
=
new
List
<
Models
.
Common
.
CategoryDto
>();
foreach
(
var
item
in
arr
)
{
listcategory
.
AddRange
(
Services
.
CommonServices
.
GetCategoryListAll
(
AllCategory
,
int
.
Parse
(
item
)));
}
var
s
=
string
.
Join
(
","
,
listcategory
.
Select
(
a
=>
a
.
C_ID
));
if
(!
string
.
IsNullOrEmpty
(
s
))
{
sqlwhere
+=
" and t2.category_id in ("
+
s
+
")"
;
}
}
}
sqlwhere
+=
" where 1=1 "
;
if
(!
string
.
IsNullOrWhiteSpace
(
warehousecode
))
{
sqlwhere
+=
" and t1.warehouse_code=@warehouse_code"
;
sqlparam
.
Add
(
"warehouse_code"
,
warehousecode
);
}
if
(
categoryid
.
HasValue
)
{
sqlwhere
+=
" and t2.category_id=@category_id"
;
sqlparam
.
Add
(
"category_id"
,
categoryid
.
Value
);
}
if
(
minordercount
.
HasValue
&&
minordercount
.
Value
>
0
)
{
sqlwhere
+=
" and (t1.fourteenday_total_sales/14)>=@minordercount"
;
sqlparam
.
Add
(
"minordercount"
,
minordercount
.
Value
);
}
if
(
maxordercount
.
HasValue
&&
maxordercount
.
Value
>
0
)
{
sqlwhere
+=
" and (t1.fourteenday_total_sales/14)<@maxordercount"
;
sqlparam
.
Add
(
"maxordercount"
,
maxordercount
.
Value
);
}
if
(
stockmin
.
HasValue
)
{
sqlwhere
+=
" and t1.usable_stock>=@stockmin"
;
sqlparam
.
Add
(
"stockmin"
,
stockmin
.
Value
);
}
if
(
stockmax
.
HasValue
)
{
sqlwhere
+=
" and t1.usable_stock<@stockmax"
;
sqlparam
.
Add
(
"stockmax"
,
stockmax
.
Value
);
}
if
(
stockamountmin
.
HasValue
)
{
sqlwhere
+=
" and t1.amount_stock>=@stockamountmin"
;
sqlparam
.
Add
(
"stockamountmin"
,
stockamountmin
.
Value
);
}
if
(
stockamountmax
.
HasValue
)
{
sqlwhere
+=
" and t1.amount_stock<@stockamountmax"
;
sqlparam
.
Add
(
"stockamountmax"
,
stockamountmax
.
Value
);
}
if
(
push_status
.
HasValue
)
{
sqlwhere
+=
" and t2.push_status="
+
push_status
.
Value
;
}
if
(
available_days_start
.
HasValue
)
{
sqlwhere
+=
" and t1.available_days>="
+
available_days_start
.
Value
;
}
if
(
available_days_end
.
HasValue
)
{
sqlwhere
+=
" and t1.available_days<"
+
available_days_end
.
Value
;
}
if
(
onedaysalescount
.
HasValue
&&
onedaysalescount
.
Value
>=
0
)
{
//sqlwhere += " and t1.oneday_total_sales";
switch
(
onedaysalescount
.
Value
)
{
case
0
:
sqlwhere
+=
" and t1.oneday_total_sales=0"
;
break
;
case
1
:
sqlwhere
+=
" and t1.oneday_total_sales>0 && t1.oneday_total_sales<=1"
;
break
;
case
2
:
sqlwhere
+=
" and t1.oneday_total_sales>1 && t1.oneday_total_sales<=5"
;
break
;
case
5
:
sqlwhere
+=
" and t1.oneday_total_sales>5 && t1.oneday_total_sales<=10"
;
break
;
case
10
:
sqlwhere
+=
" and t1.oneday_total_sales>10"
;
break
;
default
:
sqlwhere
+=
" and t1.oneday_total_sales="
+
onedaysalescount
.
Value
;
break
;
}
}
using
(
var
cn
=
new
MySqlConnection
(
Common
.
GlobalConfig
.
ConnectionString_read
))
{
if
(
cn
.
State
==
System
.
Data
.
ConnectionState
.
Closed
)
{
cn
.
Open
();
}
var
obj
=
cn
.
QueryFirstOrDefault
<
Models
.
Stock
.
mSkuWarehouse
>(
sql
+
sqlwhere
,
sqlparam
);
return
obj
;
}
}
/// <summary>
/// 根据仓库设置属性获取仓库列表
/// </summary>
/// <param name="type"></param>
...
...
Bailun.DC.Web/Areas/Reports/Controllers/WarehouseController.cs
View file @
e5e79865
...
...
@@ -272,9 +272,14 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
}
}
var
obj
=
new
Services
.
WareHouseServices
().
ListWareHouseSku
(
parameter
,
warehousecode
,
null
,
minordercount
,
maxordercount
,
stockmin
,
stockmax
,
stockamountmin
,
stockamountmax
,
skucategoryids
,
push_status
,
available_days_start
,
available_days_end
,
ref
total
,
onedaysalescount
);
var
_service
=
new
Services
.
WareHouseServices
();
var
obj
=
_service
.
ListWareHouseSku
(
parameter
,
warehousecode
,
null
,
minordercount
,
maxordercount
,
stockmin
,
stockmax
,
stockamountmin
,
stockamountmax
,
skucategoryids
,
push_status
,
available_days_start
,
available_days_end
,
ref
total
,
onedaysalescount
);
var
objCount
=
_service
.
ListWareHouseSkuCount
(
warehousecode
,
null
,
minordercount
,
maxordercount
,
stockmin
,
stockmax
,
stockamountmin
,
stockamountmax
,
skucategoryids
,
push_status
,
available_days_start
,
available_days_end
,
onedaysalescount
);
var
list
=
obj
.
Select
(
p
=>
new
{
amount_onedaysale
=
p
.
amount_onedaysale
??
0
,
amount_stock
=
p
.
amount_stock
??
0
,
amount_transit
=
p
.
amount_transit
??
0
,
...
...
@@ -317,7 +322,39 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
});
return
JsonConvert
.
SerializeObject
(
new
{
total
=
total
,
rows
=
list
});
return
JsonConvert
.
SerializeObject
(
new
{
total
=
total
,
rows
=
list
,
count_row
=
new
{
sku_title_cn
=
"合计"
,
amount_onedaysale
=
objCount
.
amount_onedaysale
??
0
,
amount_stock
=
objCount
.
amount_stock
??
0
,
amount_transit
=
objCount
.
amount_transit
??
0
,
noshippingcount
=
objCount
.
noshippingcount
??
0
,
nostockcount
=
objCount
.
nostockcount
??
0
,
oneday_total_sales
=
objCount
.
oneday_total_sales
??
0
,
purchase_amount
=
objCount
.
purchase_amount
??
0
,
quantity_purchase
=
objCount
.
quantity_purchase
??
0
,
quantity_transfer
=
objCount
.
quantity_transfer
??
0
,
sevenday_total_sales
=
objCount
.
sevenday_total_sales
??
0
,
thirtyday_total_sales
=
objCount
.
thirtyday_total_sales
??
0
,
usable_stock
=
objCount
.
usable_stock
??
0
,
quantity_tuneout_onway
=
objCount
.
quantity_tuneout_onway
??
0
,
quantity_tuneout_30days
=
objCount
.
quantity_tuneout_30days
,
quantity_tunein_30days
=
(
objCount
.
quantity_tunein_30days
??
0
),
fourteenday_total_sales
=
(
objCount
.
fourteenday_total_sales
??
0
),
cash_in_30days
=
(
objCount
.
cash_in_30days
??
0
).
ToString
(
"N2"
),
cash_out_30days
=
(
objCount
.
cash_out_30days
??
0
).
ToString
(
"N2"
),
cash_net
=
(
objCount
.
cash_net
??
0
).
ToString
(
"N2"
),
pin_rate_stock
=
((
objCount
.
pin_rate_stock
??
0
)
*
100
).
ToString
(
"N2"
),
amount_tunein_30days
=
(
objCount
.
amount_tunein_30days
??
0
).
ToString
(
"N2"
),
amount_tuneout_30days
=
(
objCount
.
amount_tuneout_30days
??
0
).
ToString
(
"N2"
),
sevenday_total_sales_amount
=
(
objCount
.
sevenday_total_sales_amount
).
ToString
(
"N2"
),
fourteenday_total_sales_amount
=
(
objCount
.
fourteenday_total_sales_amount
??
0
).
ToString
(
"N2"
),
thirtyday_total_sales_amount
=
(
objCount
.
thirtyday_total_sales_amount
??
0
).
ToString
(
"N2"
)
}
});
}
public
ActionResult
ExportWareHouseSku
(
string
code
,
int
?
push_status
,
int
?
minordercount
,
int
?
maxordercount
,
int
?
stockmin
,
int
?
stockmax
,
decimal
?
stockamountmin
,
decimal
?
stockamountmax
,
string
skucategoryids
,
string
available_days
)
...
...
Bailun.DC.Web/Areas/Reports/Views/Warehouse/ListWareHouseSku.cshtml
View file @
e5e79865
This diff is collapsed.
Click to expand it.
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