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
ed357cd2
Commit
ed357cd2
authored
Jan 19, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
229f9772
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
216 additions
and
6 deletions
+216
-6
MarketConsultantModule.cs
Edu.Module.Customer/MarketConsultantModule.cs
+211
-2
UserCenterController.cs
Edu.WebApi/Controllers/User/UserCenterController.cs
+5
-4
No files found.
Edu.Module.Customer/MarketConsultantModule.cs
View file @
ed357cd2
...
...
@@ -67,14 +67,15 @@ namespace Edu.Module.Customer
/// <summary>
/// 生成市场部统计数据
/// </summary>
public
void
CreateDataModule
(
DateTime
StartTime
)
public
void
Create
Market
DataModule
(
DateTime
StartTime
)
{
var
newTime
=
StartTime
.
AddDays
(-
1
);
string
start
=
Common
.
ConvertHelper
.
FormatDate
(
newTime
);
var
empList
=
accountRepository
.
GetEmployeeListRepository
(
new
Employee_ViewModel
()
{
QDeptIds
=
"4,13"
,
//市场部编号4,课程顾问部编号13
QDeptIds
=
"4"
,
Group_Id
=
100000
,
IsLeave
=
1
});
...
...
@@ -270,6 +271,214 @@ namespace Edu.Module.Customer
}
}
/// <summary>
/// 生成课程顾问部数据
/// </summary>
/// <param name="StartTime"></param>
public
void
CreateConsultantDataModule
(
DateTime
StartTime
)
{
var
newTime
=
StartTime
.
AddDays
(-
1
);
string
start
=
Common
.
ConvertHelper
.
FormatDate
(
newTime
);
var
empList
=
accountRepository
.
GetEmployeeListRepository
(
new
Employee_ViewModel
()
{
//市场部编号4,课程顾问部编号13
QDeptIds
=
"13"
,
Group_Id
=
100000
,
IsLeave
=
1
});
if
(
empList
!=
null
&&
empList
.
Count
>
0
)
{
foreach
(
var
item
in
empList
)
{
RB_MarketConsultant_Extend
model
=
new
RB_MarketConsultant_Extend
()
{
CreateBy
=
item
.
Id
,
Group_Id
=
item
.
Group_Id
,
Date
=
newTime
,
DeptId
=
item
.
Dept_Id
,
};
//1.条数(资源量)
var
dicList
=
studentRepository
.
GetStudentClueRepository
(
new
RB_Student_ViewModel
()
{
StartTime
=
start
});
if
(
dicList
!=
null
&&
dicList
.
Count
>
0
)
{
foreach
(
var
sItem
in
dicList
)
{
if
(
sItem
.
Key
==
"today"
)
{
model
.
ClueCount
=
sItem
.
Value
?.
Where
(
qitem
=>
qitem
.
CreateBy
==
item
.
Id
)?.
FirstOrDefault
()?.
ClueCount
??
0
;
}
else
if
(
sItem
.
Key
==
"yestoday"
)
{
model
.
YestodayClue
=
sItem
.
Value
?.
Where
(
qitem
=>
qitem
.
CreateBy
==
item
.
Id
)?.
FirstOrDefault
()?.
ClueCount
??
0
;
}
else
if
(
sItem
.
Key
==
"currentWeek"
)
{
model
.
CurWeekClue
=
sItem
.
Value
?.
Where
(
qitem
=>
qitem
.
CreateBy
==
item
.
Id
)?.
FirstOrDefault
()?.
ClueCount
??
0
;
}
else
if
(
sItem
.
Key
==
"lastWeek"
)
{
model
.
LastWeekClue
=
sItem
.
Value
?.
Where
(
qitem
=>
qitem
.
CreateBy
==
item
.
Id
)?.
FirstOrDefault
()?.
ClueCount
??
0
;
}
else
if
(
sItem
.
Key
==
"curMonth"
)
{
model
.
CurMonthClue
=
sItem
.
Value
?.
Where
(
qitem
=>
qitem
.
CreateBy
==
item
.
Id
)?.
FirstOrDefault
()?.
ClueCount
??
0
;
}
else
if
(
sItem
.
Key
==
"lastMonth"
)
{
model
.
LastMonthClue
=
sItem
.
Value
?.
Where
(
qitem
=>
qitem
.
CreateBy
==
item
.
Id
)?.
FirstOrDefault
()?.
ClueCount
??
0
;
}
}
}
var
followList
=
student_FollowRepository
.
GetStudentFollowStaticRepository
(
new
RB_Student_Follow_Extend
()
{
STime
=
start
});
//2.有效数据量 (第一次跟进且不等于流失)
if
(
followList
!=
null
&&
followList
.
Count
>
0
)
{
foreach
(
var
sItem
in
followList
)
{
if
(
sItem
.
Key
==
"today"
)
{
model
.
FollowCount
=
sItem
.
Value
?.
Where
(
qitem
=>
qitem
.
CreateBy
==
item
.
Id
)?.
FirstOrDefault
()?.
FollowCount
??
0
;
}
else
if
(
sItem
.
Key
==
"yestoday"
)
{
model
.
YestodayFollow
=
sItem
.
Value
?.
Where
(
qitem
=>
qitem
.
CreateBy
==
item
.
Id
)?.
FirstOrDefault
()?.
FollowCount
??
0
;
}
else
if
(
sItem
.
Key
==
"currentWeek"
)
{
model
.
CurWeekFollow
=
sItem
.
Value
?.
Where
(
qitem
=>
qitem
.
CreateBy
==
item
.
Id
)?.
FirstOrDefault
()?.
FollowCount
??
0
;
}
else
if
(
sItem
.
Key
==
"lastWeek"
)
{
model
.
LastWeekFollow
=
sItem
.
Value
?.
Where
(
qitem
=>
qitem
.
CreateBy
==
item
.
Id
)?.
FirstOrDefault
()?.
FollowCount
??
0
;
}
else
if
(
sItem
.
Key
==
"curMonth"
)
{
model
.
CurMonthFollow
=
sItem
.
Value
?.
Where
(
qitem
=>
qitem
.
CreateBy
==
item
.
Id
)?.
FirstOrDefault
()?.
FollowCount
??
0
;
}
else
if
(
sItem
.
Key
==
"lastMonth"
)
{
model
.
LastMonthFollow
=
sItem
.
Value
?.
Where
(
qitem
=>
qitem
.
CreateBy
==
item
.
Id
)?.
FirstOrDefault
()?.
FollowCount
??
0
;
}
}
}
//3.上门咨询
var
visitList
=
student_VisitRepository
.
GetVisitStaticRepository
(
new
RB_Student_Visit_Extend
()
{
StartDate
=
start
});
if
(
visitList
!=
null
&&
visitList
.
Count
>
0
)
{
foreach
(
var
sItem
in
visitList
)
{
if
(
sItem
.
Key
==
"today"
)
{
model
.
VisitCount
=
sItem
.
Value
?.
Where
(
qitem
=>
qitem
.
CreateBy
==
item
.
Id
)?.
FirstOrDefault
()?.
VisitCount
??
0
;
}
else
if
(
sItem
.
Key
==
"yestoday"
)
{
model
.
YestodayVisit
=
sItem
.
Value
?.
Where
(
qitem
=>
qitem
.
CreateBy
==
item
.
Id
)?.
FirstOrDefault
()?.
VisitCount
??
0
;
}
else
if
(
sItem
.
Key
==
"currentWeek"
)
{
model
.
CurWeekVisit
=
sItem
.
Value
?.
Where
(
qitem
=>
qitem
.
CreateBy
==
item
.
Id
)?.
FirstOrDefault
()?.
VisitCount
??
0
;
}
else
if
(
sItem
.
Key
==
"lastWeek"
)
{
model
.
LastWeekVisit
=
sItem
.
Value
?.
Where
(
qitem
=>
qitem
.
CreateBy
==
item
.
Id
)?.
FirstOrDefault
()?.
VisitCount
??
0
;
}
else
if
(
sItem
.
Key
==
"curMonth"
)
{
model
.
CurMonthVisit
=
sItem
.
Value
?.
Where
(
qitem
=>
qitem
.
CreateBy
==
item
.
Id
)?.
FirstOrDefault
()?.
VisitCount
??
0
;
}
else
if
(
sItem
.
Key
==
"lastMonth"
)
{
model
.
LastMonthVisit
=
sItem
.
Value
?.
Where
(
qitem
=>
qitem
.
CreateBy
==
item
.
Id
)?.
FirstOrDefault
()?.
VisitCount
??
0
;
}
}
}
//4.试听邀约
var
trialLessonList
=
visitor_ReserveRepository
.
GetVisitorStaticRepository
(
new
RB_Visitor_Reserve_Extend
()
{
StartClassDate
=
start
});
if
(
trialLessonList
!=
null
&&
trialLessonList
.
Count
>
0
)
{
foreach
(
var
sItem
in
trialLessonList
)
{
if
(
sItem
.
Key
==
"today"
)
{
model
.
TrialLessonCount
=
sItem
.
Value
?.
Where
(
qitem
=>
qitem
.
CreateBy
==
item
.
Id
)?.
FirstOrDefault
()?.
TrialLessonCount
??
0
;
}
else
if
(
sItem
.
Key
==
"yestoday"
)
{
model
.
YestodayTrialLesson
=
sItem
.
Value
?.
Where
(
qitem
=>
qitem
.
CreateBy
==
item
.
Id
)?.
FirstOrDefault
()?.
TrialLessonCount
??
0
;
}
else
if
(
sItem
.
Key
==
"currentWeek"
)
{
model
.
CurWeekTrialLesson
=
sItem
.
Value
?.
Where
(
qitem
=>
qitem
.
CreateBy
==
item
.
Id
)?.
FirstOrDefault
()?.
TrialLessonCount
??
0
;
}
else
if
(
sItem
.
Key
==
"lastWeek"
)
{
model
.
LastWeekTrialLesson
=
sItem
.
Value
?.
Where
(
qitem
=>
qitem
.
CreateBy
==
item
.
Id
)?.
FirstOrDefault
()?.
TrialLessonCount
??
0
;
}
else
if
(
sItem
.
Key
==
"curMonth"
)
{
model
.
CurMonthTrialLesson
=
sItem
.
Value
?.
Where
(
qitem
=>
qitem
.
CreateBy
==
item
.
Id
)?.
FirstOrDefault
()?.
TrialLessonCount
??
0
;
}
else
if
(
sItem
.
Key
==
"lastMonth"
)
{
model
.
LastMonthTrialLesson
=
sItem
.
Value
?.
Where
(
qitem
=>
qitem
.
CreateBy
==
item
.
Id
)?.
FirstOrDefault
()?.
TrialLessonCount
??
0
;
}
}
}
//5.销售额(签约量)
var
orderList
=
orderRepository
.
GetMarketMarketConsultantStaticRepository
(
new
RB_Order_ViewModel
()
{
StartTime
=
start
});
if
(
orderList
!=
null
&&
orderList
.
Count
>
0
)
{
foreach
(
var
sItem
in
orderList
)
{
if
(
sItem
.
Key
==
"today"
)
{
model
.
SaleMoney
=
sItem
.
Value
?.
Where
(
qitem
=>
(
qitem
.
EnterID
==
item
.
Id
||
qitem
.
CourseConsultantId
==
item
.
Id
))?.
Sum
(
qitem
=>
qitem
.
Income
)
??
0
;
}
else
if
(
sItem
.
Key
==
"yestoday"
)
{
model
.
YestodaySale
=
sItem
.
Value
?.
Where
(
qitem
=>
(
qitem
.
EnterID
==
item
.
Id
||
qitem
.
CourseConsultantId
==
item
.
Id
))?.
Sum
(
qitem
=>
qitem
.
Income
)
??
0
;
}
else
if
(
sItem
.
Key
==
"currentWeek"
)
{
model
.
CurWeekSale
=
sItem
.
Value
?.
Where
(
qitem
=>
(
qitem
.
EnterID
==
item
.
Id
||
qitem
.
CourseConsultantId
==
item
.
Id
))?.
Sum
(
qitem
=>
qitem
.
Income
)
??
0
;
}
else
if
(
sItem
.
Key
==
"lastWeek"
)
{
model
.
LastWeekSale
=
sItem
.
Value
?.
Where
(
qitem
=>
(
qitem
.
EnterID
==
item
.
Id
||
qitem
.
CourseConsultantId
==
item
.
Id
))?.
Sum
(
qitem
=>
qitem
.
Income
)
??
0
;
}
else
if
(
sItem
.
Key
==
"curMonth"
)
{
model
.
CurMonrhSale
=
sItem
.
Value
?.
Where
(
qitem
=>
(
qitem
.
EnterID
==
item
.
Id
||
qitem
.
CourseConsultantId
==
item
.
Id
))?.
Sum
(
qitem
=>
qitem
.
Income
)
??
0
;
}
else
if
(
sItem
.
Key
==
"lastMonth"
)
{
model
.
LastMonthSale
=
sItem
.
Value
?.
Where
(
qitem
=>
(
qitem
.
EnterID
==
item
.
Id
||
qitem
.
CourseConsultantId
==
item
.
Id
))?.
Sum
(
qitem
=>
qitem
.
Income
)
??
0
;
}
}
}
marketConsultantRepository
.
InsertMarketConsultantRepository
(
model
);
}
}
}
/// <summary>
/// 市场人员统计
/// </summary>
...
...
Edu.WebApi/Controllers/User/UserCenterController.cs
View file @
ed357cd2
...
...
@@ -2530,7 +2530,7 @@ namespace Edu.WebApi.Controllers.User
[
HttpPost
]
public
ApiResult
CreateMarketData
()
{
string
startTime
=
"2022-01-0
1
"
;
string
startTime
=
"2022-01-0
2
"
;
string
endTime
=
Common
.
ConvertHelper
.
FormatDate
(
DateTime
.
Now
);
var
start
=
Convert
.
ToDateTime
(
startTime
);
var
end
=
Convert
.
ToDateTime
(
endTime
);
...
...
@@ -2540,7 +2540,8 @@ namespace Edu.WebApi.Controllers.User
{
for
(
var
i
=
0
;
i
<
days
;
i
++)
{
marketConsultantModule
.
CreateDataModule
(
start
.
AddDays
(
i
));
marketConsultantModule
.
CreateMarketDataModule
(
start
.
AddDays
(
i
));
marketConsultantModule
.
CreateConsultantDataModule
(
start
.
AddDays
(
i
));
}
});
return
ApiResult
.
Success
();
...
...
@@ -2554,12 +2555,12 @@ namespace Edu.WebApi.Controllers.User
public
ApiResult
MarketStatic
()
{
string
startTime
=
base
.
ParmJObj
.
GetStringValue
(
"startTime"
);
if
(
!
string
.
IsNullOrEmpty
(
startTime
))
if
(
string
.
IsNullOrEmpty
(
startTime
))
{
startTime
=
"2022-01-01"
;
}
string
endTime
=
base
.
ParmJObj
.
GetStringValue
(
"endTime"
);
if
(
!
string
.
IsNullOrEmpty
(
endTime
))
if
(
string
.
IsNullOrEmpty
(
endTime
))
{
endTime
=
Common
.
ConvertHelper
.
FormatDate
(
DateTime
.
Now
);
}
...
...
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