Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
Project
Project
Details
Activity
Releases
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
黄奎
Education
Commits
cfec307d
Commit
cfec307d
authored
Feb 11, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
e5d85c86
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
19 deletions
+27
-19
CustomerModule.cs
Edu.Module.Customer/CustomerModule.cs
+16
-0
RB_CustomerRepository.cs
Edu.Repository/Customer/RB_CustomerRepository.cs
+3
-3
B2BCustomerController.cs
Edu.WebApi/Controllers/Customer/B2BCustomerController.cs
+8
-16
No files found.
Edu.Module.Customer/CustomerModule.cs
View file @
cfec307d
...
...
@@ -57,6 +57,11 @@ namespace Edu.Module.Customer
/// </summary>
private
readonly
RB_Customer_CategoryRepository
customer_CategoryRepository
=
new
RB_Customer_CategoryRepository
();
/// <summary>
/// 员工账号仓储层
/// </summary>
private
readonly
RB_AccountRepository
accountRepository
=
new
RB_AccountRepository
();
/// <summary>
/// 获取客户分页列表..
...
...
@@ -269,6 +274,13 @@ namespace Edu.Module.Customer
if
(
list
.
Any
())
{
string
customerIds
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
CustomerId
));
string
createByIds
=
string
.
Join
(
","
,
list
.
Where
(
qitem
=>
qitem
.
CreateBy
>
0
).
Select
(
qitem
=>
qitem
.
CreateBy
));
var
empList
=
new
List
<
Employee_ViewModel
>();
if
(!
string
.
IsNullOrEmpty
(
createByIds
))
{
empList
=
accountRepository
.
GetEmployeeListRepository
(
new
Employee_ViewModel
()
{
QIds
=
createByIds
});
}
//查询客户数量
var
StuNumList
=
customerRepository
.
GetCustomerStuNum
(
customerIds
,
query
.
Group_Id
);
//查询订单数量 及 交易额
...
...
@@ -281,6 +293,10 @@ namespace Edu.Module.Customer
item
.
StuNum
=
stuList
?.
Sum
(
qitem
=>
qitem
.
StuNum
)??
0
;
item
.
OrderNum
=
orderList
?.
Sum
(
qitem
=>
qitem
.
OrderNum
)
??
0
;
item
.
OrderSales
=
orderList
?.
Sum
(
qitem
=>
qitem
.
OrderSales
)
??
0
;
if
(
item
.
CreateBy
>
0
)
{
item
.
CreateByName
=
empList
?.
FirstOrDefault
(
qitem
=>
qitem
.
Id
==
item
.
CreateBy
)?.
EmployeeName
??
""
;
}
}
}
return
list
;
...
...
Edu.Repository/Customer/RB_CustomerRepository.cs
View file @
cfec307d
...
...
@@ -183,11 +183,11 @@ WHERE 1=1
public
List
<
RB_Customer_Extend
>
GetCustomerStuNum
(
string
customerIds
,
int
group_Id
)
{
string
sql
=
$@"
SELECT
s
.CustomerId,C.CategoryId,COUNT(0) as StuNum
SELECT
c
.CustomerId,C.CategoryId,COUNT(0) as StuNum
FROM rb_student s INNER JOIN rb_customer AS c ON (s.StuSourceId=C.CustomerId AND s.CreateType=2)
WHERE s.`Status`=0 and s.Group_Id =
{
group_Id
}
and
s
.CustomerId in(
{
customerIds
}
)
GROUP BY
s
.CustomerId,C.CategoryId
and
c
.CustomerId in(
{
customerIds
}
)
GROUP BY
c
.CustomerId,C.CategoryId
"
;
return
Get
<
RB_Customer_Extend
>(
sql
).
ToList
();
}
...
...
Edu.WebApi/Controllers/Customer/B2BCustomerController.cs
View file @
cfec307d
...
...
@@ -512,13 +512,7 @@ namespace Edu.WebApi.Controllers.Customer
};
query
.
CreateBy
=
userInfo
.
Id
;
var
list
=
customerModule
.
GetCustomerPageModule_V2
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
foreach
(
var
item
in
list
)
{
if
(
item
.
CreateBy
>
0
)
{
item
.
CreateByName
=
UserReidsCache
.
GetUserLoginInfo
(
item
.
CreateBy
)?.
AccountName
??
""
;
}
}
pageModel
.
PageData
=
list
.
Select
(
x
=>
new
{
x
.
CustomerId
,
...
...
@@ -564,13 +558,7 @@ namespace Edu.WebApi.Controllers.Customer
CategoryId
=
base
.
ParmJObj
.
GetInt
(
"CategoryId"
),
};
var
list
=
customerModule
.
GetCustomerPageModule_V2
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
foreach
(
var
item
in
list
)
{
if
(
item
.
CreateBy
>
0
)
{
item
.
CreateByName
=
UserReidsCache
.
GetUserLoginInfo
(
item
.
CreateBy
)?.
AccountName
??
""
;
}
}
pageModel
.
PageData
=
list
.
Select
(
x
=>
new
{
x
.
CustomerId
,
...
...
@@ -617,7 +605,10 @@ namespace Edu.WebApi.Controllers.Customer
CategoryId
=
base
.
ParmJObj
.
GetInt
(
"CategoryId"
),
};
string
excelName
=
"同行联系人.xls"
;
Common
.
Plugin
.
StopwatchHelper
stopwatch
=
new
StopwatchHelper
();
stopwatch
.
Start
();
var
list
=
customerModule
.
GetCustomerPageModule_V2
(
1
,
100000
,
out
long
rowsCount
,
query
);
var
xx
=
stopwatch
.
Stop
();
List
<
ExcelDataSource
>
slist
=
new
List
<
ExcelDataSource
>();
try
{
...
...
@@ -655,13 +646,14 @@ namespace Edu.WebApi.Controllers.Customer
new
ExcelColumn
(
item
.
OrderSales
.
ToString
()),
new
ExcelColumn
(
item
.
ApproveStateStr
),
new
ExcelColumn
(
item
.
CreateTimeStr
),
new
ExcelColumn
(
UserReidsCache
.
GetUserLoginInfo
(
item
.
CreateBy
)?.
AccountName
??
""
),
new
ExcelColumn
(
item
.
CreateByName
),
}
};
slist
.
Add
(
dataRow
);
}
stopwatch
.
Start
();
var
byteData
=
ExcelTempLateHelper
.
ToExcelExtend
(
slist
);
var
yy
=
stopwatch
.
Stop
();
return
File
(
byteData
,
"application/octet-stream"
,
excelName
);
}
catch
(
Exception
ex
)
...
...
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