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
af7a4890
Commit
af7a4890
authored
Sep 26, 2020
by
泽锋 李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
56b1d6be
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
114 additions
and
14 deletions
+114
-14
connectionHelper.cs
AutoTurnOver.DB/Base/connectionHelper.cs
+3
-14
report.cs
AutoTurnOver.DB/report.cs
+0
-0
report_stock_week_view_dto.cs
AutoTurnOver.Models/Report/report_stock_week_view_dto.cs
+19
-0
ReportServices.cs
AutoTurnOver.Services/ReportServices.cs
+22
-0
ReportsController.cs
AutoTurnOver/Controllers/ReportsController.cs
+70
-0
No files found.
AutoTurnOver.DB/Base/connectionHelper.cs
View file @
af7a4890
...
...
@@ -47,31 +47,21 @@ namespace AutoTurnOver.DB
void
IDisposable
.
Dispose
()
{
_connection
.
Dispose
();
__connection
=
null
;
}
private
static
MySqlConnection
__connection
;
public
static
MySqlConnection
_connection
{
get
{
if
(
__connection
==
null
)
{
__connection
=
new
MySqlConnection
(
ConfigHelper
.
ConnectionString
(
"Default"
));
}
return
__connection
;
return
new
MySqlConnection
(
ConfigHelper
.
ConnectionString
(
"Default"
));
}
}
private
static
MySqlConnection
__connection_read_only
;
public
static
MySqlConnection
_connection_read_only
{
get
{
if
(
__connection_read_only
==
null
)
{
__connection_read_only
=
new
MySqlConnection
(
ConfigHelper
.
ConnectionString
(
"ReadOnly"
));
}
return
__connection_read_only
;
return
new
MySqlConnection
(
ConfigHelper
.
ConnectionString
(
"ReadOnly"
));
}
}
...
...
@@ -83,7 +73,6 @@ namespace AutoTurnOver.DB
public
void
Close
()
{
_connection
.
Close
();
__connection
=
null
;
}
public
int
Execute
(
string
sql
,
object
param
=
null
,
IDbTransaction
transaction
=
null
,
int
?
commandTimeout
=
null
,
CommandType
?
commandType
=
null
)
{
...
...
AutoTurnOver.DB/report.cs
View file @
af7a4890
This diff is collapsed.
Click to expand it.
AutoTurnOver.Models/Report/report_stock_week_view_dto.cs
View file @
af7a4890
...
...
@@ -45,4 +45,23 @@ namespace AutoTurnOver.Models.Report
public
decimal
stock_amount
{
get
;
set
;
}
public
int
is_order
{
get
;
set
;
}
}
public
class
dc_report_purchase_week
{
public
int
id
{
get
;
set
;
}
public
string
week_tag
{
get
;
set
;
}
/// <summary>
/// 1 = 采购 2= 调拨
/// </summary>
public
int
type
{
get
;
set
;
}
public
string
warehouse_code
{
get
;
set
;
}
public
string
bailun_sku
{
get
;
set
;
}
public
int
stock
{
get
;
set
;
}
public
decimal
unit_price
{
get
;
set
;
}
public
int
is_new
{
get
;
set
;
}
public
int
quantity_purchase
{
get
;
set
;
}
public
decimal
amount_paid
{
get
;
set
;
}
public
string
web_site
{
get
;
set
;
}
public
DateTime
first_day_date
{
get
;
set
;
}
}
}
AutoTurnOver.Services/ReportServices.cs
View file @
af7a4890
...
...
@@ -894,6 +894,28 @@ namespace AutoTurnOver.Services
}
public
List
<
dynamic
>
ReportPurchaseWeekView
(
report_stock_week_view_search_dto
search_data
)
{
var
order_list
=
report
.
ReportPurchaseWeekView
(
search_data
);
List
<
dynamic
>
datas
=
new
List
<
dynamic
>();
foreach
(
var
item
in
order_list
)
{
dynamic
o
=
new
ExpandoObject
();
o
.
web_site
=
item
.
web_site
;
o
.
tag
=
item
.
tag
;
foreach
(
var
dat_item
in
item
.
weeks
)
{
var
dic
=
(
IDictionary
<
string
,
object
>)
o
;
dic
[
"val_"
+
(
dat_item
.
tag
)]
=
Math
.
Round
(
dat_item
.
val
,
2
);
}
datas
.
Add
(
o
);
}
return
datas
;
}
public
List
<
string
>
ReportStockWeekViewGetWeekList
(
report_stock_week_view_search_dto
search
)
{
return
report
.
ReportStockWeekViewGetWeekList
(
search
);
...
...
AutoTurnOver/Controllers/ReportsController.cs
View file @
af7a4890
...
...
@@ -726,6 +726,76 @@ namespace AutoTurnOver.Controllers
return
File
(
memory
,
"text/csv"
,
"第三方海外仓统计表.csv"
);
}
[
BrowseLog
(
"Bailun_aims"
,
"访问【百伦自动周转系统】->【报表】->【第三方海外仓采购汇总】->【搜索】页面"
,
0
)]
public
JsonResult
ReportPurchaseWeekView
(
DateTime
?
btime
,
DateTime
?
etime
)
{
report_stock_week_view_search_dto
search_data
=
new
report_stock_week_view_search_dto
{
etime
=
etime
,
btime
=
btime
};
var
list
=
new
ReportServices
().
ReportPurchaseWeekView
(
search_data
);
return
new
JsonResult
(
new
{
rows
=
list
,
total
=
0
,
});
}
[
BrowseLog
(
"Bailun_aims"
,
"访问【百伦自动周转系统】->【报表】->【第三方海外仓采购汇总】->【导出】"
,
0
)]
public
FileResult
ExportTableReportPurchaseWeekView
(
DateTime
?
btime
,
DateTime
?
etime
)
{
report_stock_week_view_search_dto
search_data
=
new
report_stock_week_view_search_dto
{
etime
=
etime
,
btime
=
btime
};
var
list
=
new
ReportServices
().
ReportPurchaseWeekView
(
search_data
);
var
time_list
=
new
ReportServices
().
ReportStockWeekViewGetWeekList
(
search_data
);
DataTable
table
=
new
DataTable
();
string
[]
cols
=
new
string
[]
{
"站点"
,
"标签"
};
foreach
(
var
item
in
cols
)
{
table
.
Columns
.
Add
(
item
);
}
foreach
(
var
item
in
time_list
)
{
table
.
Columns
.
Add
(
$"
{
item
}
"
);
}
foreach
(
var
itemDataD
in
list
)
{
DataRow
row
=
table
.
NewRow
();
var
itemData
=
(
IDictionary
<
string
,
object
>)
itemDataD
;
row
[
"站点"
]
=
itemData
[
"web_site"
];
row
[
"标签"
]
=
itemData
[
"tag"
];
foreach
(
var
item
in
time_list
)
{
row
[
$"
{
item
}
"
]
=
itemData
[
"val_"
+
$"
{
item
}
"
];
}
table
.
Rows
.
Add
(
row
);
}
var
fileName
=
AppContext
.
BaseDirectory
+
@"Result\RealtimeStock\第三方海外仓采购统计表.csv"
;
DataTableHelper
.
SaveCSV
(
table
,
fileName
);
var
memory
=
new
MemoryStream
();
using
(
var
stream
=
new
FileStream
(
fileName
,
FileMode
.
Open
))
{
stream
.
CopyTo
(
memory
);
}
memory
.
Position
=
0
;
return
File
(
memory
,
"text/csv"
,
"第三方海外仓采购统计表.csv"
);
}
public
JsonResult
ReportStockWeekViewGetWeekList
(
DateTime
?
btime
,
DateTime
?
etime
)
{
report_stock_week_view_search_dto
search_data
=
new
report_stock_week_view_search_dto
...
...
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