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
7df6cc78
Commit
7df6cc78
authored
Aug 19, 2021
by
zhouminghui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
c23b105b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
13 deletions
+32
-13
FinanceService.cs
Bailun.DC.Services/WebApiService/FinanceService.cs
+30
-8
FinanceController.cs
Bailun.DC.WebApi/Controllers/FinanceController.cs
+2
-5
No files found.
Bailun.DC.Services/WebApiService/FinanceService.cs
View file @
7df6cc78
...
...
@@ -464,6 +464,8 @@ and s1.management_cost_name = @managementcostname";
/// </summary>
/// <param name="month"></param>
/// <param name="financecategory"></param>
/// <param name="isCost">统计成本</param>
/// <param name="falg"></param>
/// <returns></returns>
public
List
<
PlatformTypeMonthlyStatisticsDto
>
GetPlatformTypeMonthlyStatistics
(
string
month
,
string
financecategory
,
bool
isCost
=
false
,
bool
falg
=
false
)
{
...
...
@@ -865,7 +867,7 @@ s2.financecategory AS FinanceCategory,s2.datacenter_col AS DatacenterCol,s2.curr
s1.exchange_rate AS ExchangeRate,s1.amountval_rmb AS AmountValRmb,s1.month AS Month
from order_fee_value_amazon s1
JOIN order_fee_config s2
ON s2.id = s1.order_fee_config_id WHERE s1.
amountval != 0 AND s1.
month = @month "
);
ON s2.id = s1.order_fee_config_id WHERE s1.month = @month "
);
}
parameters
.
Add
(
"month"
,
input
.
Month
);
if
(
input
.
FeeName
.
Contains
(
"加:营业外收入"
))
...
...
@@ -1116,7 +1118,7 @@ AND financecategoryname LIKE '{financecategory.Replace("产品", "")}%' ";
time
=
DateTime
.
Now
.
AddMonths
(-
1
).
ToString
(
"yyyy-MM"
);
}
var
sql
=
$"select * from dc_month_sales_profit_v2 where isedit != 1 and month = '
{
time
}
'"
;
var
oldData
=
SimpleCRUD
.
Query
<
dc_month_sales_profit_v2
>(
sql
,
null
,
GlobalConfig
.
ConnectionString
).
FirstOrDefault
();
var
oldData
=
SimpleCRUD
.
Query
<
dc_month_sales_profit_v2
>(
sql
,
null
,
GlobalConfig
.
ConnectionString
).
FirstOrDefault
()
??
new
dc_month_sales_profit_v2
()
;
//对旧表数据进行赋值新数据
//var field = new MonthSalesProfitDto();
//var name = field.amount_sales_jingyou.GetType().GetCustomAttribute<System.ComponentModel.DisplayNameAttribute>().DisplayName;
...
...
@@ -1262,7 +1264,14 @@ AND financecategoryname LIKE '{financecategory.Replace("产品", "")}%' ";
{
cn
.
Open
();
}
var
result
=
cn
.
Update
(
oldData
);
if
(
oldData
.
id
>
0
)
{
cn
.
Update
(
oldData
);
}
else
{
cn
.
Insert
(
oldData
);
}
}
return
true
;
}
...
...
@@ -1309,6 +1318,8 @@ AND financecategoryname LIKE '{financecategory.Replace("产品", "")}%' ";
financecategoryname
=
name
,
summary_type
=
0
}));
//成本
list
.
AddRange
(
GetPlatformTypeMonthlyStatistics
(
time
,
name
,
true
,
true
).
Select
(
x
=>
new
dc_month_sales_profit_order_summary
{
month
=
time
,
...
...
@@ -1321,15 +1332,26 @@ AND financecategoryname LIKE '{financecategory.Replace("产品", "")}%' ";
summary_type
=
1
}));
}
foreach
(
var
item
in
list
)
using
(
var
cn
=
new
MySqlConnection
(
Common
.
GlobalConfig
.
ConnectionString
)
)
{
using
(
var
cn
=
new
MySqlConnection
(
Common
.
GlobalConfig
.
ConnectionString
))
if
(
cn
.
State
==
ConnectionState
.
Closed
)
{
cn
.
Open
();
}
foreach
(
var
item
in
list
)
{
if
(
cn
.
State
==
ConnectionState
.
Closed
)
var
querySql
=
$@"SELECT id FROM dc_month_sales_profit_order_summary WHERE month = '
{
item
.
month
}
'
AND platform_type = '
{
item
.
platform_type
}
' AND financecategoryname = '
{
item
.
financecategoryname
}
' AND summary_type =
{
item
.
summary_type
}
"
;
var
exist
=
cn
.
Query
<
int
>(
querySql
).
FirstOrDefault
();
if
(
exist
>
0
)
{
item
.
id
=
exist
;
cn
.
Update
(
item
);
}
else
{
cn
.
Open
(
);
cn
.
Insert
(
item
);
}
cn
.
Insert
(
item
);
}
}
return
true
;
...
...
Bailun.DC.WebApi/Controllers/FinanceController.cs
View file @
7df6cc78
...
...
@@ -451,9 +451,7 @@ namespace Bailun.DC.WebApi.Controllers
var
list
=
new
List
<
string
>();
foreach
(
var
item
in
dataList
)
{
list
.
Add
(
$@"
{
item
.
PlatForm
}
|
{
item
.
WebSite
}
|
{
item
.
DataTime
}
|
{
item
.
Orderno
}
|
{
item
.
Currency
}
|
{
item
.
AmountVal
}
|
{
item
.
ExchangeRate
}
|
{
item
.
AmountValRmb
}{
item
.
FeeType
}
|
{
item
.
FinanceCategory
}
|
{
item
.
DatacenterCol
}
|
{
item
.
Subjectcode
}
|
{
item
.
ProjectCode
}
"
);
list
.
Add
(
$"
{
item
.
PlatForm
}
|
{
item
.
WebSite
}
|
{
item
.
DataTime
}
|
{
item
.
Orderno
}
|
{
item
.
Currency
}
|
{
item
.
AmountVal
}
|
{
item
.
ExchangeRate
}
|
{
item
.
AmountValRmb
}
|
{
item
.
FeeType
}
|
{
item
.
FinanceCategory
}
|
{
item
.
DatacenterCol
}
|
{
item
.
Subjectcode
}
|
{
item
.
ProjectCode
}
"
);
}
var
guid
=
Guid
.
NewGuid
().
ToString
();
var
filepath
=
_hostingEnvironment
.
WebRootPath
+
"\\Files\\Report\\"
+
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
)
+
"\\"
;
...
...
@@ -504,8 +502,7 @@ namespace Bailun.DC.WebApi.Controllers
var
list
=
new
List
<
string
>();
foreach
(
var
item
in
dataList
.
Data
.
Data
)
{
list
.
Add
(
$@"
{
item
.
financecategoryname
}
|
{
item
.
platform_type
}
|
{
item
.
origin_order_id
}
|
{
item
.
bailun_sku
}
|
{
item
.
sale_profit
}
|
{
item
.
quantity_shipped
}
|
{
item
.
shipping_time
}
|
{
item
.
createtime
}
"
);
list
.
Add
(
$"
{
item
.
financecategoryname
}
|
{
item
.
platform_type
}
|
{
item
.
origin_order_id
}
|
{
item
.
bailun_sku
}
|
{
item
.
sale_profit
}
|
{
item
.
quantity_shipped
}
|
{
item
.
shipping_time
}
|
{
item
.
createtime
}
"
);
}
var
guid
=
Guid
.
NewGuid
().
ToString
();
var
filepath
=
_hostingEnvironment
.
WebRootPath
+
"\\Files\\Report\\"
+
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
)
+
"\\"
;
...
...
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