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
f9631355
Commit
f9631355
authored
Dec 09, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/education
parents
66376dbe
a74cd15e
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
387 additions
and
31 deletions
+387
-31
StudentLogTypeEnum.cs
Edu.Common/Enum/Log/StudentLogTypeEnum.cs
+7
-0
ConvertHelper.cs
Edu.Common/Plugin/ConvertHelper.cs
+30
-0
RB_Student_Log.cs
Edu.Model/Entity/Customer/RB_Student_Log.cs
+5
-0
RB_Student_Visit_Extend.cs
Edu.Model/ViewModel/Customer/RB_Student_Visit_Extend.cs
+9
-0
CustomerStudentModule.cs
Edu.Module.Customer/CustomerStudentModule.cs
+126
-7
StudentModule.cs
Edu.Module.User/StudentModule.cs
+4
-2
RB_Student_AppointmentRepository.cs
Edu.Repository/Customer/RB_Student_AppointmentRepository.cs
+15
-1
RB_Student_FollowRepository.cs
Edu.Repository/Customer/RB_Student_FollowRepository.cs
+15
-2
RB_Student_LogRepository.cs
Edu.Repository/Customer/RB_Student_LogRepository.cs
+5
-3
RB_Student_VisitRepository.cs
Edu.Repository/Customer/RB_Student_VisitRepository.cs
+13
-3
RB_StudentRepository.cs
Edu.Repository/User/RB_StudentRepository.cs
+27
-0
CustomerStudentController.cs
Edu.WebApi/Controllers/Customer/CustomerStudentController.cs
+67
-7
UserController.cs
Edu.WebApi/Controllers/User/UserController.cs
+64
-6
No files found.
Edu.Common/Enum/Log/StudentLogTypeEnum.cs
View file @
f9631355
...
...
@@ -33,5 +33,12 @@ namespace Edu.Common.Enum.Log
/// </summary>
[
EnumField
(
"试听"
)]
TrialLesson
=
4
,
/// <summary>
/// 试听
/// </summary>
[
EnumField
(
"基础资料"
)]
BasicInfo
=
5
,
}
}
Edu.Common/Plugin/ConvertHelper.cs
View file @
f9631355
...
...
@@ -63,6 +63,36 @@ namespace Edu.Common
return
timeStr
;
}
/// <summary>
/// 获取时间格式yyyy-MM-dd HH:mm
/// </summary>
/// <param name="time"></param>
/// <returns></returns>
public
static
string
FormatTimeStr2
(
this
object
time
)
{
string
timeStr
=
""
;
if
(
time
!=
null
)
{
try
{
var
newTime
=
Convert
.
ToDateTime
(
time
.
ToString
());
if
(
newTime
.
Year
==
DateTime
.
Now
.
Year
)
{
timeStr
=
Convert
.
ToDateTime
(
time
.
ToString
()).
ToString
(
"MM-dd HH:mm"
);
}
else
{
timeStr
=
Convert
.
ToDateTime
(
time
.
ToString
()).
ToString
(
"yyyy-MM-dd HH:mm"
);
}
}
catch
{
}
}
return
timeStr
;
}
/// <summary>
/// 获取时间格式
/// </summary>
...
...
Edu.Model/Entity/Customer/RB_Student_Log.cs
View file @
f9631355
...
...
@@ -28,6 +28,11 @@ namespace Edu.Model.Entity.Customer
/// </summary>
public
StudentLogTypeEnum
LogType
{
get
;
set
;
}
/// <summary>
/// 日志标题
/// </summary>
public
string
LogTitle
{
get
;
set
;
}
/// <summary>
/// 日志内容
/// </summary>
...
...
Edu.Model/ViewModel/Customer/RB_Student_Visit_Extend.cs
View file @
f9631355
...
...
@@ -10,5 +10,14 @@ namespace Edu.Model.ViewModel.Customer
/// </summary>
public
class
RB_Student_Visit_Extend
:
RB_Student_Visit
{
/// <summary>
/// 校区名称
/// </summary>
public
string
SchoolName
{
get
;
set
;
}
/// <summary>
/// 接待人姓名
/// </summary>
public
string
ReceptionPersionName
{
get
;
set
;
}
}
}
Edu.Module.Customer/CustomerStudentModule.cs
View file @
f9631355
using
Edu.Common.Enum
;
using
Edu.Model.ViewModel.Customer
;
using
Edu.Repository.Customer
;
using
Edu.Repository.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
using
System.Linq
;
namespace
Edu.Module.Customer
{
...
...
@@ -33,6 +35,16 @@ namespace Edu.Module.Customer
/// </summary>
private
readonly
RB_Student_LogRepository
student_LogRepository
=
new
RB_Student_LogRepository
();
/// <summary>
/// 校区仓储层对象
/// </summary>
private
readonly
RB_SchoolRepository
schoolRepository
=
new
RB_SchoolRepository
();
/// <summary>
/// 员工对象仓储层对象
/// </summary>
private
readonly
RB_AccountRepository
accountRepository
=
new
RB_AccountRepository
();
#
region
学员约访
...
...
@@ -58,8 +70,26 @@ namespace Edu.Module.Customer
{
bool
flag
=
false
;
string
logContent
=
""
;
string
logTitle
=
""
;
if
(
model
.
Id
>
0
)
{
var
oldModel
=
GetStudentAppointmentModule
(
model
.
Id
);
if
(
oldModel
.
AppointmentPoint
!=
model
.
AppointmentPoint
)
{
logContent
+=
string
.
Format
(
"约访地点:由【{0}】=>【{1}】,"
,
oldModel
.
AppointmentPoint
,
model
.
AppointmentPoint
);
}
if
(
oldModel
.
AppointmentTime
!=
model
.
AppointmentTime
)
{
logContent
+=
string
.
Format
(
"约访时间:由【{0}】=>【{1}】,"
,
oldModel
.
AppointmentTime
,
model
.
AppointmentTime
);
}
if
(
oldModel
.
Remark
!=
model
.
Remark
)
{
logContent
+=
string
.
Format
(
"备注:由【{0}】=>【{1}】,,"
,
oldModel
.
Remark
,
model
.
Remark
);
}
if
(
oldModel
.
Feedback
!=
model
.
Feedback
)
{
logContent
+=
string
.
Format
(
"反馈:由【{0}】=>【{1}】,"
,
oldModel
.
Feedback
,
model
.
Feedback
);
}
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Student_Appointment_Extend
.
AppointmentPoint
),
model
.
AppointmentPoint
},
...
...
@@ -68,15 +98,18 @@ namespace Edu.Module.Customer
{
nameof
(
RB_Student_Appointment_Extend
.
Feedback
),
model
.
Feedback
},
};
flag
=
student_AppointmentRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Student_Appointment_Extend
.
Id
),
model
.
Id
));
logTitle
=
"修改学员约访"
;
}
else
{
var
newId
=
student_AppointmentRepository
.
Insert
(
model
);
model
.
Id
=
newId
;
flag
=
newId
>
0
;
logTitle
=
"新增学员约访"
;
logContent
=
model
.
Remark
;
}
student_LogRepository
.
AddStuLogRepository
(
model
.
StuId
,
Common
.
Enum
.
Log
.
StudentLogTypeEnum
.
Appointment
,
logContent
,
model
.
CreateBy
);
student_LogRepository
.
AddStuLogRepository
(
model
.
StuId
,
Common
.
Enum
.
Log
.
StudentLogTypeEnum
.
Appointment
,
log
Title
,
log
Content
,
model
.
CreateBy
);
return
flag
;
}
...
...
@@ -96,14 +129,16 @@ namespace Edu.Module.Customer
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public
bool
RemoveStudentAppointmentModule
(
object
Id
)
public
bool
RemoveStudentAppointmentModule
(
object
Id
,
int
Uid
)
{
bool
flag
=
false
;
var
model
=
GetStudentAppointmentModule
(
Id
);
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Student_Appointment_Extend
.
Status
),(
int
)
DateStateEnum
.
Delete
}
};
flag
=
student_AppointmentRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Student_Appointment_Extend
.
Id
),
Id
));
student_LogRepository
.
AddStuLogRepository
(
model
.
StuId
,
Common
.
Enum
.
Log
.
StudentLogTypeEnum
.
Appointment
,
"删除约访"
,
"删除约访信息"
,
Uid
);
return
flag
;
}
...
...
@@ -133,21 +168,30 @@ namespace Edu.Module.Customer
{
bool
flag
=
false
;
string
logContent
=
""
;
string
logTitle
=
""
;
if
(
model
.
Id
>
0
)
{
var
oldModel
=
GetStudentFollowModule
(
model
.
Id
);
if
(
oldModel
.
Remark
!=
model
.
Remark
)
{
logContent
+=
string
.
Format
(
"跟进内容:由【{0}】=>【{1}】"
,
oldModel
.
Remark
,
model
.
Remark
);
}
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Student_Follow_Extend
.
Remark
),
model
.
Remark
}
};
flag
=
student_FollowRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Student_Follow_Extend
.
Id
),
model
.
Id
));
logTitle
=
"修改跟进内容"
;
}
else
{
var
newId
=
student_FollowRepository
.
Insert
(
model
);
model
.
Id
=
newId
;
flag
=
newId
>
0
;
logTitle
=
"新增跟进"
;
logContent
=
model
.
Remark
;
}
student_LogRepository
.
AddStuLogRepository
(
model
.
StuId
,
Common
.
Enum
.
Log
.
StudentLogTypeEnum
.
Follow
,
logContent
,
model
.
CreateBy
);
student_LogRepository
.
AddStuLogRepository
(
model
.
StuId
,
Common
.
Enum
.
Log
.
StudentLogTypeEnum
.
Follow
,
log
Title
,
log
Content
,
model
.
CreateBy
);
return
flag
;
}
...
...
@@ -167,12 +211,14 @@ namespace Edu.Module.Customer
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public
bool
RemoveStudentFollowModule
(
object
Id
)
public
bool
RemoveStudentFollowModule
(
object
Id
,
int
Uid
)
{
var
model
=
GetStudentFollowModule
(
Id
);
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Student_Follow_Extend
.
Status
),
(
int
)
DateStateEnum
.
Delete
}
};
student_LogRepository
.
AddStuLogRepository
(
model
.
StuId
,
Common
.
Enum
.
Log
.
StudentLogTypeEnum
.
Follow
,
"删除跟进"
,
"删除跟进信息"
,
Uid
);
return
student_FollowRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Student_Follow_Extend
.
Id
),
Id
));
}
#
endregion
...
...
@@ -189,7 +235,25 @@ namespace Edu.Module.Customer
/// <returns></returns>
public
List
<
RB_Student_Visit_Extend
>
GetStudentVisitPageModule
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Student_Visit_Extend
query
)
{
return
student_VisitRepository
.
GetStudentVisitPageRepository
(
pageIndex
,
pageSize
,
out
rowsCount
,
query
);
var
list
=
student_VisitRepository
.
GetStudentVisitPageRepository
(
pageIndex
,
pageSize
,
out
rowsCount
,
query
);
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
string
sids
=
string
.
Join
(
","
,
list
.
Select
(
qitem
=>
qitem
.
School_Id
));
string
empIds
=
string
.
Join
(
","
,
list
.
Select
(
qitem
=>
qitem
.
ReceptionPersion
));
var
schoolList
=
schoolRepository
.
GetSchoolListRepository
(
new
Model
.
ViewModel
.
User
.
RB_School_ViewModel
()
{
QSIds
=
sids
});
var
empList
=
accountRepository
.
GetEmployeeListRepository
(
new
Model
.
ViewModel
.
User
.
Employee_ViewModel
()
{
QIds
=
empIds
});
foreach
(
var
item
in
list
)
{
item
.
SchoolName
=
schoolList
?.
FirstOrDefault
(
qitem
=>
qitem
.
SId
==
item
.
School_Id
)?.
SName
??
""
;
item
.
ReceptionPersionName
=
empList
?.
FirstOrDefault
(
qitem
=>
qitem
.
Id
==
item
.
ReceptionPersion
)?.
EmployeeName
??
""
;
}
}
return
list
;
}
/// <summary>
...
...
@@ -201,8 +265,44 @@ namespace Edu.Module.Customer
{
bool
flag
=
false
;
string
logContent
=
""
;
string
logTitle
=
""
;
if
(
model
.
Id
>
0
)
{
var
oldModel
=
GetStudentVisitModule
(
model
.
Id
);
logTitle
=
"修改到访"
;
if
(
oldModel
.
School_Id
!=
model
.
School_Id
)
{
var
schoolList
=
schoolRepository
.
GetSchoolListRepository
(
new
Model
.
ViewModel
.
User
.
RB_School_ViewModel
()
{
QSIds
=
oldModel
.
School_Id
+
","
+
model
.
School_Id
});
logContent
+=
string
.
Format
(
"校区:由【{0}】=>【{1}】,"
,
schoolList
.
FirstOrDefault
(
qitem
=>
qitem
.
SId
==
oldModel
.
School_Id
)?.
SName
,
schoolList
.
FirstOrDefault
(
qitem
=>
qitem
.
SId
==
model
.
School_Id
)?.
SName
);
}
if
(
oldModel
.
Date
!=
model
.
Date
)
{
logContent
+=
string
.
Format
(
"日期:由【{0}】=>【{1}】,"
,
Common
.
ConvertHelper
.
FormatDate
(
oldModel
.
Date
),
Common
.
ConvertHelper
.
FormatDate
(
model
.
Date
));
}
if
(
oldModel
.
VisitTime
!=
model
.
VisitTime
)
{
logContent
+=
string
.
Format
(
"到访时间:由【{0}】=>【{1}】,"
,
oldModel
.
VisitTime
,
model
.
VisitTime
);
}
if
(
oldModel
.
ReceptionPersion
!=
model
.
ReceptionPersion
)
{
var
empList
=
accountRepository
.
GetEmployeeListRepository
(
new
Model
.
ViewModel
.
User
.
Employee_ViewModel
()
{
QIds
=
oldModel
.
ReceptionPersion
+
","
+
model
.
ReceptionPersion
});
logContent
+=
string
.
Format
(
"接待人:由【{0}】=>【{1}】,"
,
empList
?.
FirstOrDefault
(
qitem
=>
qitem
.
Id
==
oldModel
.
ReceptionPersion
)?.
EmployeeName
,
empList
?.
FirstOrDefault
(
qitem
=>
qitem
.
Id
==
model
.
ReceptionPersion
)?.
EmployeeName
);
}
if
(
oldModel
.
Remark
!=
model
.
Remark
)
{
logContent
+=
string
.
Format
(
"备注:由【{0}】=>【{1}】,"
,
oldModel
.
Remark
,
model
.
Remark
);
}
if
(
oldModel
.
Feedback
!=
model
.
Feedback
)
{
logContent
+=
string
.
Format
(
"反馈信息:由【{0}】=>【{1}】,"
,
oldModel
.
Feedback
,
model
.
Feedback
);
}
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Student_Visit_Extend
.
School_Id
),
model
.
School_Id
},
...
...
@@ -219,8 +319,10 @@ namespace Edu.Module.Customer
var
newId
=
student_VisitRepository
.
Insert
(
model
);
model
.
Id
=
newId
;
flag
=
newId
>
0
;
logTitle
=
"新增到访"
;
logContent
=
model
.
Remark
;
}
student_LogRepository
.
AddStuLogRepository
(
model
.
StuId
,
Common
.
Enum
.
Log
.
StudentLogTypeEnum
.
Visit
,
logContent
,
model
.
CreateBy
);
student_LogRepository
.
AddStuLogRepository
(
model
.
StuId
,
Common
.
Enum
.
Log
.
StudentLogTypeEnum
.
Visit
,
log
Title
,
log
Content
,
model
.
CreateBy
);
return
flag
;
}
...
...
@@ -240,14 +342,31 @@ namespace Edu.Module.Customer
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public
bool
RemoveStudentVisitModule
(
object
Id
)
public
bool
RemoveStudentVisitModule
(
object
Id
,
int
Uid
)
{
var
model
=
GetStudentVisitModule
(
Id
);
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Student_Visit_Extend
.
Status
),
(
int
)
DateStateEnum
.
Delete
}
};
student_LogRepository
.
AddStuLogRepository
(
model
.
StuId
,
Common
.
Enum
.
Log
.
StudentLogTypeEnum
.
Visit
,
"删除到访"
,
"删除客户到访"
,
Uid
);
return
student_VisitRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Student_Visit_Extend
.
Id
),
Id
));
}
#
endregion
/// <summary>
/// 获取学员日志分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Student_Log_Extend
>
GetStudentLogPageModule
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Student_Log_Extend
query
)
{
var
list
=
student_LogRepository
.
GetStudentLogPageRepository
(
pageIndex
,
pageSize
,
out
rowsCount
,
query
);
return
list
;
}
}
}
Edu.Module.User/StudentModule.cs
View file @
f9631355
...
...
@@ -155,8 +155,10 @@ namespace Edu.Module.User
bool
IsInsert
=
false
;
if
(
model
.
StuId
==
0
)
{
IsInsert
=
true
;
}
bool
flag
=
studentRepository
.
SetStudentRepository
(
model
);
if
(
flag
)
{
if
(
IsInsert
&&
model
.
CustomerId
>
0
)
{
if
(
flag
)
{
if
(
IsInsert
&&
model
.
CustomerId
>
0
)
{
var
queryTargetWorkId
=
accountModule
.
GetWorkUserIdModule
(
model
.
CreateBy
);
if
(!
string
.
IsNullOrEmpty
(
queryTargetWorkId
))
{
...
...
Edu.Repository/Customer/RB_Student_AppointmentRepository.cs
View file @
f9631355
using
Edu.Model.Entity.Customer
;
using
Edu.Common.Enum
;
using
Edu.Model.Entity.Customer
;
using
Edu.Model.ViewModel.Customer
;
using
System
;
using
System.Collections.Generic
;
...
...
@@ -28,6 +29,19 @@ SELECT A.*
FROM RB_Student_Appointment AS A
WHERE 1=1
"
);
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Student_Appointment_Extend
.
Status
),
(
int
)
DateStateEnum
.
Normal
);
if
(
query
!=
null
)
{
if
(
query
.
Group_Id
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Student_Appointment_Extend
.
Group_Id
),
query
.
Group_Id
);
}
if
(
query
.
StuId
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Student_Appointment_Extend
.
StuId
),
query
.
StuId
);
}
}
builder
.
AppendFormat
(
" ORDER BY A.{0} DESC "
,
nameof
(
RB_Student_Appointment_Extend
.
Id
));
return
GetPage
<
RB_Student_Appointment_Extend
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
()).
ToList
();
}
...
...
Edu.Repository/Customer/RB_Student_FollowRepository.cs
View file @
f9631355
using
Edu.Model.Entity.Customer
;
using
Edu.Common.Enum
;
using
Edu.Model.Entity.Customer
;
using
Edu.Model.ViewModel.Customer
;
using
System
;
using
System.Collections.Generic
;
...
...
@@ -28,7 +29,19 @@ SELECT A.*
FROM RB_Student_Follow AS A
WHERE 1=1
"
);
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Student_Follow_Extend
.
Status
),
(
int
)
DateStateEnum
.
Normal
);
if
(
query
!=
null
)
{
if
(
query
.
Group_Id
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Student_Follow_Extend
.
Group_Id
),
query
.
Group_Id
);
}
if
(
query
.
StuId
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Student_Follow_Extend
.
StuId
),
query
.
StuId
);
}
}
builder
.
AppendFormat
(
" ORDER BY A.{0} DESC "
,
nameof
(
RB_Student_Follow_Extend
.
Id
));
return
GetPage
<
RB_Student_Follow_Extend
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
()).
ToList
();
}
}
...
...
Edu.Repository/Customer/RB_Student_LogRepository.cs
View file @
f9631355
...
...
@@ -34,7 +34,7 @@ WHERE 1=1
{
if
(
query
.
StuId
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Student_Log_Extend
.
StuId
),
query
.
StuId
);
//
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Log_Extend.StuId), query.StuId);
}
}
builder
.
AppendFormat
(
" ORDER BY A.{0} DESC "
,
nameof
(
RB_Student_Log_Extend
.
LogId
));
...
...
@@ -46,20 +46,22 @@ WHERE 1=1
/// </summary>
/// <param name="StuId">学员编号</param>
/// <param name="LogType">日志类型</param>
/// <param name="LogTitle">日志标题</param>
/// <param name="LogContent">日志内容</param>
/// <param name="CreateBy">创建人</param>
/// <param name="CreateType">创建人类型(1-系统用户,2-同行用户)</param>
/// <param name="Group_Id">集团编号</param>
/// <returns></returns>
public
bool
AddStuLogRepository
(
int
StuId
,
StudentLogTypeEnum
LogType
,
string
LogContent
,
int
CreateBy
,
int
CreateType
=
1
,
int
Group_Id
=
100000
)
public
bool
AddStuLogRepository
(
int
StuId
,
StudentLogTypeEnum
LogType
,
string
LogTitle
,
string
LogContent
,
int
CreateBy
,
int
CreateType
=
1
,
int
Group_Id
=
100000
)
{
var
newModel
=
new
RB_Student_Log_Extend
()
{
LogId
=
0
,
StuId
=
StuId
,
LogType
=
LogType
,
CreateTime
=
DateTime
.
Now
,
LogTitle
=
LogTitle
,
LogContent
=
LogContent
,
CreateTime
=
DateTime
.
Now
,
CreateType
=
CreateType
,
CreateBy
=
CreateBy
,
Group_Id
=
Group_Id
...
...
Edu.Repository/Customer/RB_Student_VisitRepository.cs
View file @
f9631355
using
Edu.Model.Entity.Customer
;
using
Edu.Common.Enum
;
using
Edu.Model.Entity.Customer
;
using
Edu.Model.ViewModel.Customer
;
using
System
;
using
System.Collections.Generic
;
...
...
@@ -28,10 +29,19 @@ SELECT A.*
FROM RB_Student_Visit AS A
WHERE 1=1
"
);
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Student_Visit_Extend
.
Status
),
(
int
)
DateStateEnum
.
Normal
);
if
(
query
!=
null
)
{
{
if
(
query
.
Group_Id
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Student_Visit_Extend
.
Group_Id
),
query
.
Group_Id
);
}
if
(
query
.
StuId
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Student_Visit_Extend
.
StuId
),
query
.
StuId
);
}
}
builder
.
AppendFormat
(
" ORDER BY A.{0} DESC "
,
nameof
(
RB_Student_Visit_Extend
.
Id
));
return
GetPage
<
RB_Student_Visit_Extend
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
()).
ToList
();
}
}
...
...
Edu.Repository/User/RB_StudentRepository.cs
View file @
f9631355
using
Edu.Common.Enum
;
using
Edu.Model.ViewModel.User
;
using
Edu.Repository.Customer
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
...
...
@@ -19,6 +20,11 @@ namespace Edu.Repository.User
/// </summary>
private
readonly
RB_AccountRepository
accountRepository
=
new
RB_AccountRepository
();
/// <summary>
/// 学员日志仓储层对象
/// </summary>
private
readonly
RB_Student_LogRepository
student_LogRepository
=
new
RB_Student_LogRepository
();
/// <summary>
/// 获取学生列表
/// </summary>
...
...
@@ -194,8 +200,13 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 an
public
bool
SetStudentRepository
(
RB_Student_ViewModel
model
)
{
bool
flag
;
string
logContent
=
""
;
string
logTitle
=
""
;
int
createBy
=
0
;
if
(
model
.
StuId
>
0
)
{
logTitle
=
"修改客户"
;
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Student_ViewModel
.
StuName
),
model
.
StuName
.
Trim
()
},
...
...
@@ -217,8 +228,12 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 an
{
nameof
(
RB_Student_ViewModel
.
StuContractMobile
),
model
.
StuContractMobile
},
{
nameof
(
RB_Student_ViewModel
.
StuIDCard
),
model
.
StuIDCard
},
{
nameof
(
RB_Student_ViewModel
.
StuIDCardAddress
),
model
.
StuIDCardAddress
},
{
nameof
(
RB_Student_ViewModel
.
CreateType
),
model
.
CreateType
},
{
nameof
(
RB_Student_ViewModel
.
CreateBy
),
model
.
CreateBy
},
{
nameof
(
RB_Student_ViewModel
.
StuStage
),
model
.
StuStage
},
};
flag
=
base
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Student_ViewModel
.
StuId
),
model
.
StuId
));
createBy
=
model
.
UpdateBy
;
}
else
{
...
...
@@ -243,7 +258,19 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 an
UpdateTime
=
DateTime
.
Now
,
Password
=
Common
.
DES
.
Encrypt
(
Common
.
Config
.
DefaultPwd
)
});
if
(
model
.
CreateType
==
1
)
{
createBy
=
model
.
CreateBy
;
}
else
{
createBy
=
model
.
CustomerId
;
}
logContent
=
"创建了该客户"
;
logTitle
=
"创建客户"
;
}
student_LogRepository
.
AddStuLogRepository
(
model
.
StuId
,
Common
.
Enum
.
Log
.
StudentLogTypeEnum
.
BasicInfo
,
logTitle
,
logContent
,
createBy
,
CreateType
:
model
.
CreateType
);
return
flag
;
}
}
...
...
Edu.WebApi/Controllers/Customer/CustomerStudentController.cs
View file @
f9631355
using
Edu.Common.API
;
using
Edu.Cache.User
;
using
Edu.Common.API
;
using
Edu.Common.Plugin
;
using
Edu.Model.ViewModel.Customer
;
using
Edu.Module.Customer
;
...
...
@@ -95,7 +96,7 @@ namespace Edu.WebApi.Controllers.Customer
public
ApiResult
RemoveStudentAppointment
()
{
var
Id
=
base
.
ParmJObj
.
GetInt
(
"Id"
);
var
model
=
customerStudentModule
.
RemoveStudentAppointmentModule
(
Id
);
var
model
=
customerStudentModule
.
RemoveStudentAppointmentModule
(
Id
,
base
.
UserInfo
.
Id
);
return
ApiResult
.
Success
(
data
:
model
);
}
...
...
@@ -167,7 +168,7 @@ namespace Edu.WebApi.Controllers.Customer
public
ApiResult
RemoveStudentFollow
()
{
var
Id
=
base
.
ParmJObj
.
GetInt
(
"Id"
);
var
model
=
customerStudentModule
.
RemoveStudentFollowModule
(
Id
);
var
model
=
customerStudentModule
.
RemoveStudentFollowModule
(
Id
,
base
.
UserInfo
.
Id
);
return
ApiResult
.
Success
(
data
:
model
);
}
...
...
@@ -184,13 +185,24 @@ namespace Edu.WebApi.Controllers.Customer
StuId
=
base
.
ParmJObj
.
GetInt
(
"StuId"
),
};
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
var
list
=
customerStudentModule
.
GetStudentVisitPageModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
foreach
(
var
item
in
list
)
var
data
=
customerStudentModule
.
GetStudentVisitPageModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
List
<
object
>
list
=
new
List
<
object
>();
foreach
(
var
item
in
data
)
{
string
CreateByName
=
""
;
if
(
item
.
CreateBy
>
0
)
{
// item.
CreateByName = UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName ?? "";
CreateByName
=
UserReidsCache
.
GetUserLoginInfo
(
item
.
CreateBy
)?.
AccountName
??
""
;
}
list
.
Add
(
new
{
item
.
SchoolName
,
item
.
ReceptionPersionName
,
item
.
Remark
,
item
.
Feedback
,
CreateTime
=
Common
.
ConvertHelper
.
FormatTimeStr2
(
item
.
CreateTime
),
CreateByName
,
});
}
pageModel
.
Count
=
rowsCount
;
pageModel
.
PageData
=
list
;
...
...
@@ -245,8 +257,56 @@ namespace Edu.WebApi.Controllers.Customer
public
ApiResult
RemoveStudentVisit
()
{
var
Id
=
base
.
ParmJObj
.
GetInt
(
"Id"
);
var
model
=
customerStudentModule
.
RemoveStudentVisitModule
(
Id
);
var
model
=
customerStudentModule
.
RemoveStudentVisitModule
(
Id
,
base
.
UserInfo
.
Id
);
return
ApiResult
.
Success
(
data
:
model
);
}
/// <summary>
/// 获取学员日志分页列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetStudentLogPage
()
{
var
pageModel
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
Msg
.
ToString
());
var
query
=
new
RB_Student_Log_Extend
()
{
StuId
=
base
.
ParmJObj
.
GetInt
(
"StuId"
),
};
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
var
data
=
customerStudentModule
.
GetStudentLogPageModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
List
<
object
>
list
=
new
List
<
object
>();
foreach
(
var
item
in
data
)
{
string
CreateByName
=
""
;
if
(
item
.
CreateType
>
1
)
{
CreateByName
=
UserReidsCache
.
GetUserLoginInfo
(
item
.
CreateBy
)?.
AccountName
??
""
;
}
else
{
CreateByName
=
UserReidsCache
.
GetAppletCustomerLoginInfo
(
item
.
CreateBy
)?.
CustomerName
??
""
;
}
list
.
Add
(
new
{
item
.
LogId
,
item
.
StuId
,
item
.
LogType
,
LogTypeName
=
item
.
LogType
.
ToName
(),
item
.
LogTitle
,
item
.
LogContent
,
item
.
CreateType
,
CreateTypeStr
=
item
.
CreateType
==
1
?
"系统用户"
:
"同业用户"
,
CreateTimeStr
=
Common
.
ConvertHelper
.
FormatTimeStr2
(
item
.
CreateTime
),
CreateByName
});
}
pageModel
.
Count
=
rowsCount
;
pageModel
.
PageData
=
list
;
return
ApiResult
.
Success
(
data
:
pageModel
);
}
}
}
Edu.WebApi/Controllers/User/UserController.cs
View file @
f9631355
...
...
@@ -708,13 +708,49 @@ namespace Edu.WebApi.Controllers.User
[
HttpPost
]
public
ApiResult
SetStudent
()
{
var
extModel
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
RB_Student_ViewModel
>(
RequestParm
.
Msg
.
ToString
());
var
extModel
=
new
RB_Student_ViewModel
()
{
StuId
=
base
.
ParmJObj
.
GetInt
(
"StuId"
),
StuName
=
base
.
ParmJObj
.
GetStringValue
(
"StuName"
),
StuTel
=
base
.
ParmJObj
.
GetStringValue
(
"StuTel"
),
StuIcon
=
base
.
ParmJObj
.
GetStringValue
(
"StuIcon"
),
StuSex
=
base
.
ParmJObj
.
GetInt
(
"StuSex"
),
StuBirth
=
base
.
ParmJObj
.
GetDateTime
(
"StuBirth"
),
ProviceId
=
base
.
ParmJObj
.
GetInt
(
"ProviceId"
),
CityId
=
base
.
ParmJObj
.
GetInt
(
"CityId"
),
AreaId
=
base
.
ParmJObj
.
GetInt
(
"AreaId"
),
Interest
=
base
.
ParmJObj
.
GetInt
(
"Interest"
),
JapanBaseInfo
=
(
GuestBasicsEnum
)
base
.
ParmJObj
.
GetInt
(
"JapanBaseInfo"
),
StuProfession
=
base
.
ParmJObj
.
GetStringValue
(
"StuProfession"
),
StuEducation
=
(
GuestEducationEnum
)
base
.
ParmJObj
.
GetInt
(
"StuEducation"
),
StuPurpose
=
(
GuestLearningGoalsEnum
)
base
.
ParmJObj
.
GetInt
(
"StuPurpose"
),
StuSource
=
(
OrderSourceEnum
)
base
.
ParmJObj
.
GetInt
(
"StuSource"
),
StuAddress
=
base
.
ParmJObj
.
GetStringValue
(
"StuAddress"
),
StuContract
=
base
.
ParmJObj
.
GetStringValue
(
"StuContract"
),
StuContractMobile
=
base
.
ParmJObj
.
GetStringValue
(
"StuContractMobile"
),
StuIDCard
=
base
.
ParmJObj
.
GetStringValue
(
"StuIDCard"
),
StuIDCardAddress
=
base
.
ParmJObj
.
GetStringValue
(
"StuIDCardAddress"
),
StuStage
=(
StuStageEnum
)
base
.
ParmJObj
.
GetInt
(
"StuStage"
),
};
if
(
extModel
.
StuId
==
0
)
{
extModel
.
CreateType
=
1
;
}
extModel
.
Status
=
DateStateEnum
.
Normal
;
extModel
.
StuStatus
=
1
;
extModel
.
CreateTime
=
DateTime
.
Now
;
extModel
.
UpdateTime
=
DateTime
.
Now
;
extModel
.
CreateBy
=
base
.
UserInfo
.
Id
;
extModel
.
CreateTime
=
DateTime
.
Now
;
extModel
.
UpdateBy
=
base
.
UserInfo
.
Id
;
extModel
.
UpdateTime
=
DateTime
.
Now
;
extModel
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
extModel
.
CustomerId
=
0
;
extModel
.
IsDisable
=
1
;
if
(
studentModule
.
CheckStudentModule
(
extModel
))
{
return
ApiResult
.
Failed
(
"此学员手机号已绑定同行!请重新录入!"
);
}
bool
flag
=
studentModule
.
SetStudentModule
(
extModel
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
...
...
@@ -748,14 +784,20 @@ namespace Edu.WebApi.Controllers.User
StuContractMobile
=
base
.
ParmJObj
.
GetStringValue
(
"StuContractMobile"
),
StuIDCard
=
base
.
ParmJObj
.
GetStringValue
(
"StuIDCard"
),
StuIDCardAddress
=
base
.
ParmJObj
.
GetStringValue
(
"StuIDCardAddress"
),
StuStage
=(
StuStageEnum
)
base
.
ParmJObj
.
GetInt
(
"StuStage"
),
};
var
customer
=
base
.
AppletCustomerInfo
;
extModel
.
CreateType
=
2
;
if
(
extModel
.
StuId
==
0
)
{
extModel
.
StuStage
=
StuStageEnum
.
NewStu
;
}
extModel
.
Status
=
DateStateEnum
.
Normal
;
extModel
.
StuStatus
=
1
;
extModel
.
CreateBy
=
customer
.
CustomerId
;
extModel
.
CreateTime
=
DateTime
.
Now
;
extModel
.
UpdateBy
=
customer
.
CustomerId
;
extModel
.
UpdateTime
=
DateTime
.
Now
;
var
customer
=
base
.
AppletCustomerInfo
;
extModel
.
CreateBy
=
0
;
extModel
.
UpdateBy
=
0
;
extModel
.
Group_Id
=
customer
.
GroupId
;
extModel
.
CustomerId
=
customer
.
CustomerId
;
extModel
.
IsDisable
=
1
;
...
...
@@ -824,7 +866,7 @@ namespace Edu.WebApi.Controllers.User
extModel
.
StuTel
,
extModel
.
StuIcon
,
extModel
.
StuSex
,
extModel
.
StuBirth
,
StuBirth
=
Common
.
ConvertHelper
.
FormatDate
(
extModel
.
StuBirth
)
,
StuBirthStr
=
Common
.
ConvertHelper
.
FormatDate
(
extModel
.
StuBirth
),
extModel
.
ProviceId
,
extModel
.
CityId
,
...
...
@@ -849,11 +891,27 @@ namespace Edu.WebApi.Controllers.User
extModel
.
StuIDCardAddress
,
CreateTimeStr
=
Common
.
ConvertHelper
.
FormatDate
(
extModel
.
CreateTime
),
newClassStatus
,
classStatusName
classStatusName
,
extModel
.
CreateType
,
CreateTypeStr
=
extModel
.
CreateType
==
1
?
"员工录入"
:
"同业录入"
,
extModel
.
StuStage
,
StuStageName
=
extModel
.
StuStage
.
ToName
(),
extModel
.
CreateBy
,
};
return
ApiResult
.
Success
(
data
:
obj
);
}
/// <summary>
/// 获取客户状态列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetStuStageList
()
{
var
list
=
Common
.
Plugin
.
EnumHelper
.
EnumToList
(
typeof
(
StuStageEnum
));
return
ApiResult
.
Success
(
data
:
list
);
}
/// <summary>
/// 更新学生状态
/// </summary>
...
...
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