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
d8ad1f55
Commit
d8ad1f55
authored
Dec 10, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
6e5383ec
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
0 deletions
+60
-0
CustomerModule.cs
Edu.Module.Customer/CustomerModule.cs
+30
-0
RB_StudentRepository.cs
Edu.Repository/User/RB_StudentRepository.cs
+12
-0
B2BCustomerController.cs
Edu.WebApi/Controllers/Customer/B2BCustomerController.cs
+18
-0
No files found.
Edu.Module.Customer/CustomerModule.cs
View file @
d8ad1f55
using
Edu.Cache.User
;
using
Edu.Common.Enum
;
using
Edu.Common.Plugin
;
using
Edu.Model.CacheModel
;
using
Edu.Model.ViewModel.Customer
;
using
Edu.Repository.Customer
;
using
Edu.Repository.Log
;
using
Edu.Repository.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
...
...
@@ -29,6 +31,10 @@ namespace Edu.Module.Customer
/// </summary>
private
readonly
RB_Customer_RemitRepository
customer_RemitRepository
=
new
RB_Customer_RemitRepository
();
/// <summary>
/// 学生
/// </summary>
private
readonly
RB_StudentRepository
studentRepository
=
new
RB_StudentRepository
();
/// <summary>
/// 用户信息修改日志仓储层对象
/// </summary>
private
readonly
RB_User_ChangeLogRepository
changeLogRepository
=
new
RB_User_ChangeLogRepository
();
...
...
@@ -313,5 +319,29 @@ namespace Edu.Module.Customer
}
return
""
;
}
/// <summary>
/// 获取同业下所有学生阶段人数统计
/// </summary>
/// <param name="customerId"></param>
/// <param name="group_Id"></param>
/// <returns></returns>
public
object
GetCustomerStuStageStatistics
(
int
customerId
,
int
group_Id
)
{
List
<
object
>
RList
=
new
List
<
object
>();
var
list
=
studentRepository
.
GetCustomerStuStageStatistics
(
customerId
,
group_Id
);
var
elist
=
EnumHelper
.
EnumToList
(
typeof
(
Common
.
Enum
.
User
.
StuStageEnum
));
elist
=
elist
.
OrderBy
(
x
=>
x
.
Id
).
ToList
();
foreach
(
var
item
in
elist
)
{
int
Num
=
list
.
Where
(
x
=>
x
.
StuStage
==
(
Common
.
Enum
.
User
.
StuStageEnum
)
item
.
Id
).
FirstOrDefault
()?.
OrderCount
??
0
;
RList
.
Add
(
new
{
StuStage
=
item
.
Id
,
StuStageName
=
item
.
Name
,
StuNum
=
Num
});
}
return
RList
;
}
}
}
Edu.Repository/User/RB_StudentRepository.cs
View file @
d8ad1f55
...
...
@@ -273,5 +273,17 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 an
student_LogRepository
.
AddStuLogRepository
(
model
.
StuId
,
Common
.
Enum
.
Log
.
StudentLogTypeEnum
.
BasicInfo
,
logTitle
,
logContent
,
createBy
,
CreateType
:
model
.
CreateType
);
return
flag
;
}
/// <summary>
/// 获取同业下学生阶段人数统计
/// </summary>
/// <param name="customerId"></param>
/// <param name="group_Id"></param>
/// <returns></returns>
public
List
<
RB_Student_ViewModel
>
GetCustomerStuStageStatistics
(
int
customerId
,
int
group_Id
)
{
string
sql
=
$@"SELECT StuStage,COUNT(0) as OrderCount FROM rb_student WHERE Group_Id =
{
group_Id
}
and CustomerId =
{
customerId
}
GROUP BY StuStage"
;
return
Get
<
RB_Student_ViewModel
>(
sql
).
ToList
();
}
}
}
\ No newline at end of file
Edu.WebApi/Controllers/Customer/B2BCustomerController.cs
View file @
d8ad1f55
...
...
@@ -526,6 +526,24 @@ namespace Edu.WebApi.Controllers.Customer
}
}
/// <summary>
/// 获取同业下所有学生阶段人数统计
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetCustomerStuStageStatistics
()
{
var
userInfo
=
base
.
UserInfo
;
int
CustomerId
=
base
.
ParmJObj
.
GetInt
(
"CustomerId"
,
0
);
//同业ID
if
(
CustomerId
<=
0
)
{
return
ApiResult
.
ParamIsNull
();
}
var
Robj
=
customerModule
.
GetCustomerStuStageStatistics
(
CustomerId
,
userInfo
.
Group_Id
);
return
ApiResult
.
Success
(
""
,
Robj
);
}
#
endregion
}
}
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