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
bc1dc7b8
Commit
bc1dc7b8
authored
Jan 27, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
d6cc6d65
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
107 additions
and
0 deletions
+107
-0
MarketConsultantModule.cs
Edu.Module.Customer/MarketConsultantModule.cs
+103
-0
RB_StudentRepository.cs
Edu.Repository/User/RB_StudentRepository.cs
+4
-0
No files found.
Edu.Module.Customer/MarketConsultantModule.cs
View file @
bc1dc7b8
...
...
@@ -16,6 +16,7 @@ using Edu.Common.Enum;
using
Edu.Repository.System
;
using
Edu.Model.ViewModel.System
;
using
Edu.Common.Enum.User
;
using
Edu.Common.Plugin
;
namespace
Edu.Module.Customer
{
...
...
@@ -536,6 +537,7 @@ namespace Edu.Module.Customer
}
}
/// <summary>
/// 市场人员统计
/// </summary>
...
...
@@ -623,6 +625,93 @@ namespace Edu.Module.Customer
var
lastWeekList
=
lastList
?.
Where
(
qitem
=>
Common
.
ConvertHelper
.
WeekOfYear
(
qitem
.
Date
)
==
Common
.
ConvertHelper
.
WeekOfYear
(
end
.
AddDays
(-
1
))-
1
)?.
ToList
();
var
tempDataList
=
lastList
?.
Where
(
qitem
=>
Common
.
ConvertHelper
.
FormatDate
(
qitem
.
Date
)
==
Common
.
ConvertHelper
.
FormatDate
(
end
.
AddDays
(-
1
)))?.
ToList
();
//渠道数据统计
var
dataList
=
studentRepository
.
GetStudentChannelStaticRepository
(
new
RB_Student_ViewModel
()
{
StartTime
=
StartTime
,
EndTime
=
EndTime
,
CreateIds
=
Common
.
ConvertHelper
.
StringToList
(
EmpIds
)
});
//市场部个人数据
List
<
MarketChannelStaticModel
>
barList
=
new
List
<
MarketChannelStaticModel
>();
var
channelList
=
channelRepository
.
GetChannelListRepository
(
new
RB_Channel_Extend
()
{
});
var
createTypeList
=
dataList
.
GroupBy
(
qitem
=>
new
{
qitem
.
CreateType
}).
Select
(
qitem
=>
new
{
qitem
.
Key
.
CreateType
});
foreach
(
var
item
in
createTypeList
)
{
var
tempList
=
dataList
?.
Where
(
qitem
=>
qitem
.
CreateType
==
item
.
CreateType
)?.
ToList
();
if
(
item
.
CreateType
==
StuCreateTypeEnum
.
EmployeeInput
)
{
foreach
(
var
sItem
in
tempList
?.
GroupBy
(
qitem
=>
new
{
qitem
.
StuChannel
})?.
Select
(
qitem
=>
new
{
qitem
.
Key
.
StuChannel
}))
{
barList
.
Add
(
new
MarketChannelStaticModel
()
{
ChannelId
=
sItem
.
StuChannel
,
ChannelName
=
channelList
?.
FirstOrDefault
(
qitem
=>
qitem
.
Id
==
sItem
.
StuChannel
)?.
Name
??
""
,
ClueCount
=
tempList
?.
Where
(
qitem
=>
qitem
.
StuChannel
==
sItem
.
StuChannel
)?.
Sum
(
qitem
=>
qitem
.
ClueCount
)
??
0
,
VisitCount
=
tempList
?.
Where
(
qitem
=>
qitem
.
StuChannel
==
sItem
.
StuChannel
)?.
Sum
(
qitem
=>
qitem
.
VisitCount
)
??
0
,
OrderCount
=
tempList
?.
Where
(
qitem
=>
qitem
.
StuChannel
==
sItem
.
StuChannel
)?.
Sum
(
qitem
=>
qitem
.
OrderCount
)
??
0
,
OrderIncome
=
tempList
?.
Where
(
qitem
=>
qitem
.
StuChannel
==
sItem
.
StuChannel
)?.
Sum
(
qitem
=>
qitem
.
OrderIncome
)
??
0
,
});
}
}
else
if
(
item
.
CreateType
==
StuCreateTypeEnum
.
CustomerInput
)
{
barList
.
Add
(
new
MarketChannelStaticModel
()
{
ChannelId
=
100002
,
ChannelName
=
item
.
CreateType
.
ToName
(),
ClueCount
=
tempList
?.
Sum
(
qitem
=>
qitem
.
ClueCount
)
??
0
,
VisitCount
=
tempList
?.
Sum
(
qitem
=>
qitem
.
VisitCount
)
??
0
,
OrderCount
=
tempList
?.
Sum
(
qitem
=>
qitem
.
OrderCount
)
??
0
,
OrderIncome
=
tempList
?.
Sum
(
qitem
=>
qitem
.
OrderIncome
)
??
0
,
});
}
else
if
(
item
.
CreateType
==
StuCreateTypeEnum
.
InternalIntroduction
)
{
barList
.
Add
(
new
MarketChannelStaticModel
()
{
ChannelId
=
100003
,
ChannelName
=
item
.
CreateType
.
ToName
(),
ClueCount
=
tempList
?.
Sum
(
qitem
=>
qitem
.
ClueCount
)
??
0
,
VisitCount
=
tempList
?.
Sum
(
qitem
=>
qitem
.
VisitCount
)
??
0
,
OrderCount
=
tempList
?.
Sum
(
qitem
=>
qitem
.
OrderCount
)
??
0
,
OrderIncome
=
tempList
?.
Sum
(
qitem
=>
qitem
.
OrderIncome
)
??
0
,
});
}
else
if
(
item
.
CreateType
==
StuCreateTypeEnum
.
TransIntroduction
)
{
barList
.
Add
(
new
MarketChannelStaticModel
()
{
ChannelId
=
100004
,
ChannelName
=
item
.
CreateType
.
ToName
(),
ClueCount
=
tempList
?.
Sum
(
qitem
=>
qitem
.
ClueCount
)
??
0
,
VisitCount
=
tempList
?.
Sum
(
qitem
=>
qitem
.
VisitCount
)
??
0
,
OrderCount
=
tempList
?.
Sum
(
qitem
=>
qitem
.
OrderCount
)
??
0
,
OrderIncome
=
tempList
?.
Sum
(
qitem
=>
qitem
.
OrderIncome
)
??
0
,
});
}
}
//四个渠道饼状图
List
<
MarketChannelStaticModel
>
pieList
=
new
List
<
MarketChannelStaticModel
>();
foreach
(
var
item
in
createTypeList
)
{
var
tempList
=
dataList
?.
Where
(
qitem
=>
qitem
.
CreateType
==
item
.
CreateType
)?.
ToList
();
pieList
.
Add
(
new
MarketChannelStaticModel
()
{
ChannelId
=
(
int
)
item
.
CreateType
,
ChannelName
=
item
.
CreateType
.
ToName
(),
ClueCount
=
tempList
?.
Sum
(
qitem
=>
qitem
.
ClueCount
)
??
0
,
VisitCount
=
tempList
?.
Sum
(
qitem
=>
qitem
.
VisitCount
)
??
0
,
OrderCount
=
tempList
?.
Sum
(
qitem
=>
qitem
.
OrderCount
)
??
0
,
OrderIncome
=
tempList
?.
Sum
(
qitem
=>
qitem
.
OrderIncome
)
??
0
,
});
}
obj
=
new
{
dayList
,
...
...
@@ -665,6 +754,20 @@ namespace Edu.Module.Customer
LastWeekSale
=
lastWeekList
?.
Sum
(
qitem
=>
qitem
.
LastWeekSale
)
??
0
,
CurMonrhSale
=
tempDataList
?.
Sum
(
qitem
=>
qitem
.
CurMonrhSale
)
??
0
,
LastMonthSale
=
tempDataList
?.
Sum
(
qitem
=>
qitem
.
LastMonthSale
)
??
0
,
},
BarData
=
new
{
ClueData
=
barList
?.
OrderByDescending
(
qitem
=>
qitem
.
ClueCount
)?.
Select
(
qitem
=>
new
{
qitem
.
ChannelId
,
qitem
.
ChannelName
,
qitem
.
ClueCount
})?.
Take
(
10
),
VisitData
=
barList
?.
OrderByDescending
(
qitem
=>
qitem
.
VisitCount
)?.
Select
(
qitem
=>
new
{
qitem
.
ChannelId
,
qitem
.
ChannelName
,
qitem
.
VisitCount
})?.
Take
(
10
),
OrderData
=
barList
?.
OrderByDescending
(
qitem
=>
qitem
.
OrderCount
)?.
Select
(
qitem
=>
new
{
qitem
.
ChannelId
,
qitem
.
ChannelName
,
qitem
.
OrderCount
})?.
Take
(
10
),
IncomeData
=
barList
?.
OrderByDescending
(
qitem
=>
qitem
.
OrderIncome
)?.
Select
(
qitem
=>
new
{
qitem
.
ChannelId
,
qitem
.
ChannelName
,
qitem
.
OrderIncome
})?.
Take
(
10
),
},
PieData
=
new
{
ClueData
=
pieList
?.
OrderByDescending
(
qitem
=>
qitem
.
ClueCount
)?.
Select
(
qitem
=>
new
{
qitem
.
ChannelId
,
qitem
.
ChannelName
,
qitem
.
ClueCount
})?.
Take
(
10
),
VisitData
=
pieList
?.
OrderByDescending
(
qitem
=>
qitem
.
VisitCount
)?.
Select
(
qitem
=>
new
{
qitem
.
ChannelId
,
qitem
.
ChannelName
,
qitem
.
VisitCount
})?.
Take
(
10
),
OrderData
=
pieList
?.
OrderByDescending
(
qitem
=>
qitem
.
OrderCount
)?.
Select
(
qitem
=>
new
{
qitem
.
ChannelId
,
qitem
.
ChannelName
,
qitem
.
OrderCount
})?.
Take
(
10
),
IncomeData
=
pieList
?.
OrderByDescending
(
qitem
=>
qitem
.
OrderIncome
)?.
Select
(
qitem
=>
new
{
qitem
.
ChannelId
,
qitem
.
ChannelName
,
qitem
.
OrderIncome
})?.
Take
(
10
),
}
};
return
obj
;
...
...
Edu.Repository/User/RB_StudentRepository.cs
View file @
bc1dc7b8
...
...
@@ -962,6 +962,10 @@ WHERE A.Status=0
{
builder
.
AppendFormat
(
" AND A.{0}<='{1} 23:59:59' "
,
nameof
(
RB_Student_ViewModel
.
CreateTime
),
query
.
EndTime
);
}
if
(
query
.
CreateIds
!=
null
&&
query
.
CreateIds
.
Count
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0} IN({0}) "
,
nameof
(
RB_Student_ViewModel
.
CreateBy
),
string
.
Join
(
","
,
query
.
CreateIds
));
}
}
var
list
=
Get
<
RB_Student_ViewModel
>(
builder
.
ToString
()).
ToList
();
return
list
;
...
...
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