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
eba59f23
Commit
eba59f23
authored
May 31, 2019
by
guanzhenshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加获取销售账户利润接口
parent
c5908f2b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
88 additions
and
1 deletion
+88
-1
mSalerProfit.cs
Bailun.DC.Models/Orders/mSalerProfit.cs
+28
-0
OrdersServices.cs
Bailun.DC.Services/OrdersServices.cs
+46
-1
ApiController.cs
Bailun.DC.Web/Controllers/ApiController.cs
+14
-0
No files found.
Bailun.DC.Models/Orders/mSalerProfit.cs
0 → 100644
View file @
eba59f23
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Bailun.DC.Models.Orders
{
/// <summary>
/// 销售员利润
/// </summary>
public
class
mSalerProfit
{
/// <summary>
/// 销售账户id
/// </summary>
public
string
seller_id
{
get
;
set
;
}
/// <summary>
/// 销售账户
/// </summary>
public
string
seller_account
{
get
;
set
;
}
/// <summary>
/// 利润金额
/// </summary>
public
decimal
profit_total
{
get
;
set
;
}
}
}
Bailun.DC.Services/OrdersServices.cs
View file @
eba59f23
...
...
@@ -2539,7 +2539,52 @@ namespace Bailun.DC.Services
#
endregion
#
region
人员相关统计
/// <summary>
/// 销售账户利润
/// </summary>
/// <param name="start">付款开始时间</param>
/// <param name="end">付款结束时间</param>
/// <returns></returns>
public
List
<
mSalerProfit
>
ListSalerProfit
(
DateTime
?
start
,
DateTime
?
end
)
{
var
sql
=
"select seller_id,seller_account,sum(profit_total) profit_total from dc_base_oms_order where has_scalp=0 and has_innersale=0 and bailun_order_status!='Canceled'"
;
var
sqlparam
=
new
DynamicParameters
();
if
(
start
.
HasValue
)
{
sql
+=
" and paid_time>=@start"
;
sqlparam
.
Add
(
"start"
,
start
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
));
}
else
if
(
end
.
HasValue
)
{
sql
+=
" and paid_time<@end"
;
sqlparam
.
Add
(
"end"
,
end
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
));
}
sql
+=
" group by seller_id"
;
using
(
var
cn
=
new
MySqlConnection
(
Common
.
GlobalConfig
.
ConnectionString
))
{
if
(
cn
.
State
==
System
.
Data
.
ConnectionState
.
Closed
)
{
cn
.
Open
();
}
var
obj
=
cn
.
Query
<
mSalerProfit
>(
sql
,
sqlparam
).
ToList
();
return
obj
;
}
}
#
endregion
}
}
Bailun.DC.Web/Controllers/ApiController.cs
View file @
eba59f23
...
...
@@ -159,5 +159,18 @@ namespace Bailun.DC.Web.Controllers
});
}
/// <summary>
/// 获取销售帐号的利润数据
/// </summary>
/// <param name="start">开始时间</param>
/// <param name="end">结束时间</param>
/// <returns></returns>
[
HttpPost
]
public
JsonResult
ListSalerProfit
(
DateTime
?
start
,
DateTime
?
end
)
{
var
list
=
new
Services
.
OrdersServices
().
ListSalerProfit
(
start
,
end
);
return
Json
(
list
);
}
}
}
\ No newline at end of file
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