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
2326923c
Commit
2326923c
authored
Mar 11, 2024
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
d676f12d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
166 additions
and
19 deletions
+166
-19
CustomerStudentModule.cs
Edu.Module.Customer/CustomerStudentModule.cs
+139
-19
CustomerStudentController.cs
Edu.WebApi/Controllers/Customer/CustomerStudentController.cs
+27
-0
No files found.
Edu.Module.Customer/CustomerStudentModule.cs
View file @
2326923c
...
@@ -164,14 +164,15 @@ namespace Edu.Module.Customer
...
@@ -164,14 +164,15 @@ namespace Edu.Module.Customer
flag
=
newId
>
0
;
flag
=
newId
>
0
;
logTitle
=
"新增学员约访"
;
logTitle
=
"新增学员约访"
;
logContent
=
model
.
Remark
;
logContent
=
model
.
Remark
;
if
(
flag
)
{
if
(
flag
)
{
//增加 跟进记录
//增加 跟进记录
#
region
验证用户的类型
#
region
验证用户的类型
var
assistList
=
student_AssistRepository
.
GetStudentAssistListRepository
(
new
RB_Student_Assist_Extend
()
{
StuId
=
model
.
StuId
});
var
assistList
=
student_AssistRepository
.
GetStudentAssistListRepository
(
new
RB_Student_Assist_Extend
()
{
StuId
=
model
.
StuId
});
var
assistModel
=
assistList
.
Where
(
x
=>
x
.
AssistId
==
model
.
CreateBy
).
FirstOrDefault
();
var
assistModel
=
assistList
.
Where
(
x
=>
x
.
AssistId
==
model
.
CreateBy
).
FirstOrDefault
();
var
AssistType
=
assistModel
?.
AssistType
??
0
;
var
AssistType
=
assistModel
?.
AssistType
??
0
;
#
endregion
#
endregion
student_FollowRepository
.
Insert
(
new
Model
.
Entity
.
Customer
.
RB_Student_Follow
()
student_FollowRepository
.
Insert
(
new
Model
.
Entity
.
Customer
.
RB_Student_Follow
()
{
{
StuId
=
model
.
StuId
,
StuId
=
model
.
StuId
,
...
@@ -180,7 +181,7 @@ namespace Edu.Module.Customer
...
@@ -180,7 +181,7 @@ namespace Edu.Module.Customer
CreateTime
=
model
.
CreateTime
,
CreateTime
=
model
.
CreateTime
,
Group_Id
=
model
.
Group_Id
,
Group_Id
=
model
.
Group_Id
,
Id
=
0
,
Id
=
0
,
Remark
=
$"客人约访:约访时间【
{
Common
.
ConvertHelper
.
FormatTimeStr2
(
model
.
AppointmentTime
)}
】,约访地点【
{
model
.
AppointmentPoint
}
】,备注【
{
model
.
Remark
}
】"
,
Remark
=
$"客人约访:约访时间【
{
Common
.
ConvertHelper
.
FormatTimeStr2
(
model
.
AppointmentTime
)}
】,约访地点【
{
model
.
AppointmentPoint
}
】,备注【
{
model
.
Remark
}
】"
,
Status
=
DateStateEnum
.
Normal
,
Status
=
DateStateEnum
.
Normal
,
UpdateBy
=
model
.
UpdateBy
,
UpdateBy
=
model
.
UpdateBy
,
UpdateTime
=
model
.
UpdateTime
UpdateTime
=
model
.
UpdateTime
...
@@ -299,7 +300,7 @@ namespace Edu.Module.Customer
...
@@ -299,7 +300,7 @@ namespace Edu.Module.Customer
flag
=
newId
>
0
;
flag
=
newId
>
0
;
logTitle
=
"新增跟进"
;
logTitle
=
"新增跟进"
;
logContent
=
model
.
Remark
;
logContent
=
model
.
Remark
;
}
}
try
try
{
{
...
@@ -350,7 +351,125 @@ namespace Edu.Module.Customer
...
@@ -350,7 +351,125 @@ namespace Edu.Module.Customer
return
flag
;
return
flag
;
}
}
/// <summary>
/// 新增修改学员跟进
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
SetStudentBaseInfoModule
(
RB_Student_Follow_Extend
model
,
string
StuProfession
,
int
StuPurpose
)
{
bool
flag
=
false
;
string
logContent
=
""
;
string
logTitle
=
""
;
if
(!
string
.
IsNullOrWhiteSpace
(
model
.
Remark
))
{
var
assistList
=
student_AssistRepository
.
GetStudentAssistListRepository
(
new
RB_Student_Assist_Extend
()
{
StuId
=
model
.
StuId
});
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
{
#
region
验证用户的类型
var
assistModel
=
assistList
.
Where
(
x
=>
x
.
AssistId
==
model
.
CreateBy
).
FirstOrDefault
();
model
.
AssistType
=
assistModel
?.
AssistType
??
0
;
#
endregion
var
newId
=
student_FollowRepository
.
Insert
(
model
);
model
.
Id
=
newId
;
flag
=
newId
>
0
;
logTitle
=
"新增跟进"
;
logContent
=
model
.
Remark
;
}
try
{
var
smodel
=
studentRepository
.
GetEntity
(
model
.
StuId
);
string
markdownContent
=
$"`学员跟进通知` \n>**概要信息** \n>学员名称:
{
smodel
?.
StuName
??
""
}
\n>跟进内容:
{
model
.
Remark
}
\n>"
;
Common
.
Message
.
PushMessageModel
modelWork
=
new
Common
.
Message
.
PushMessageModel
()
{
CategoryId
=
PushMessageCategoryEnum
.
B2BCustomerStu
,
Content
=
markdownContent
,
CoverImg
=
""
,
CreateByName
=
"系统"
,
JumpUrl
=
""
,
WorkMsgType
=
"markdown"
,
SendTime
=
DateTime
.
Now
,
SendType
=
0
,
Title
=
"新增学员跟进通知"
,
Platform
=
5
,
};
if
(
smodel
!=
null
&&
smodel
.
CreateBy
>
0
)
{
var
queryTargetWorkId
=
accountRepository
.
GetWorkUserIdRepository
(
smodel
.
CreateBy
);
if
(!
string
.
IsNullOrEmpty
(
queryTargetWorkId
))
{
modelWork
.
ReceiveId
=
queryTargetWorkId
;
List
<
Common
.
Message
.
PushMessageModel
>
pushList
=
new
List
<
Common
.
Message
.
PushMessageModel
>()
{
modelWork
};
new
Common
.
Message
.
MessageHelper
().
SendMessage
(
pushList
);
}
}
if
(
assistList
!=
null
&&
assistList
.
Count
>
0
)
{
foreach
(
var
item
in
assistList
)
{
var
queryTargetWorkId
=
accountRepository
.
GetWorkUserIdRepository
(
item
.
AssistId
);
if
(!
string
.
IsNullOrEmpty
(
queryTargetWorkId
))
{
modelWork
.
ReceiveId
=
queryTargetWorkId
;
List
<
Common
.
Message
.
PushMessageModel
>
pushList
=
new
List
<
Common
.
Message
.
PushMessageModel
>()
{
modelWork
};
new
Common
.
Message
.
MessageHelper
().
SendMessage
(
pushList
);
}
}
}
}
catch
(
Exception
ex
)
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
"SetStudentFollowModule"
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
logContent
))
{
student_LogRepository
.
AddStuLogRepository
(
model
.
StuId
,
Common
.
Enum
.
Log
.
StudentLogTypeEnum
.
Follow
,
logTitle
,
logContent
,
model
.
CreateBy
);
}
}
if
(
model
.
StuId
>
0
)
{
logContent
=
""
;
logTitle
=
"修改客户"
;
var
oldModel
=
studentRepository
.
GetEntity
<
RB_Student_ViewModel
>(
model
.
StuId
);
if
(
oldModel
.
StuPurpose
!=
StuPurpose
)
{
string
oldName
=
learningGoalsRepository
.
GetLearningGoalsExtEntityRepository
(
oldModel
.
StuPurpose
)?.
Name
??
""
;
string
newName
=
learningGoalsRepository
.
GetLearningGoalsExtEntityRepository
(
StuPurpose
)?.
Name
??
""
;
logContent
+=
string
.
Format
(
"学习目的:由【{0}】=>【{1}】,"
,
oldName
,
newName
);
}
if
(
oldModel
.
StuProfession
!=
StuProfession
)
{
logContent
+=
string
.
Format
(
"职业:由【{0}】=>【{1}】,"
,
oldModel
.
StuProfession
,
StuProfession
);
}
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Student_ViewModel
.
StuPurpose
),
StuPurpose
},
{
nameof
(
RB_Student_ViewModel
.
StuProfession
),
StuProfession
},
};
flag
=
studentRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Student_ViewModel
.
StuId
),
model
.
StuId
));
student_LogRepository
.
AddStuLogRepository
(
model
.
StuId
,
Common
.
Enum
.
Log
.
StudentLogTypeEnum
.
BasicInfo
,
logTitle
,
logContent
,
model
.
CreateBy
,
CreateType
:
1
);
}
return
flag
;
}
/// <summary>
/// <summary>
/// 根据编号获取学员跟进信息
/// 根据编号获取学员跟进信息
...
@@ -643,7 +762,7 @@ namespace Edu.Module.Customer
...
@@ -643,7 +762,7 @@ namespace Edu.Module.Customer
#
region
学员订单和合同
#
region
学员订单和合同
/// <summary>
/// <summary>
/// 获取学员关联订单分页列表
/// 获取学员关联订单分页列表
...
@@ -725,7 +844,7 @@ namespace Edu.Module.Customer
...
@@ -725,7 +844,7 @@ namespace Edu.Module.Customer
{
nameof
(
RB_Student_Assist_Extend
.
AssistType
),
model
.
AssistType
},
{
nameof
(
RB_Student_Assist_Extend
.
AssistType
),
model
.
AssistType
},
{
nameof
(
RB_Student_Assist_Extend
.
AssistId
),
model
.
AssistId
},
{
nameof
(
RB_Student_Assist_Extend
.
AssistId
),
model
.
AssistId
},
};
};
if
(
oldModel
!=
null
&&
oldModel
.
AssistId
!=
model
.
AssistId
)
if
(
oldModel
!=
null
&&
oldModel
.
AssistId
!=
model
.
AssistId
)
{
{
logContent
+=
string
.
Format
(
"修改协同人员:【{0}】=>【{1}】"
,
logContent
+=
string
.
Format
(
"修改协同人员:【{0}】=>【{1}】"
,
empList
?.
FirstOrDefault
(
qitem
=>
qitem
.
Id
==
(
oldModel
?.
AssistId
??
0
))?.
EmployeeName
,
empList
?.
FirstOrDefault
(
qitem
=>
qitem
.
Id
==
(
oldModel
?.
AssistId
??
0
))?.
EmployeeName
,
...
@@ -738,7 +857,7 @@ namespace Edu.Module.Customer
...
@@ -738,7 +857,7 @@ namespace Edu.Module.Customer
else
else
{
{
logContent
+=
string
.
Format
(
"新增协同人员:"
+
empList
?.
FirstOrDefault
(
qitem
=>
qitem
.
Id
==
model
.
AssistId
)?.
EmployeeName
);
logContent
+=
string
.
Format
(
"新增协同人员:"
+
empList
?.
FirstOrDefault
(
qitem
=>
qitem
.
Id
==
model
.
AssistId
)?.
EmployeeName
);
logContent
+=
string
.
Format
(
" 协同类型:【{0}】"
,
model
.
AssistType
.
ToName
());
logContent
+=
string
.
Format
(
" 协同类型:【{0}】"
,
model
.
AssistType
.
ToName
());
var
newId
=
student_AssistRepository
.
Insert
(
model
);
var
newId
=
student_AssistRepository
.
Insert
(
model
);
model
.
Id
=
newId
;
model
.
Id
=
newId
;
flag
=
newId
>
0
;
flag
=
newId
>
0
;
...
@@ -747,8 +866,8 @@ namespace Edu.Module.Customer
...
@@ -747,8 +866,8 @@ namespace Edu.Module.Customer
var
stuAssistList
=
student_AssistRepository
.
GetStudentAssistListRepository
(
new
RB_Student_Assist_Extend
()
{
StuId
=
StuId
});
var
stuAssistList
=
student_AssistRepository
.
GetStudentAssistListRepository
(
new
RB_Student_Assist_Extend
()
{
StuId
=
StuId
});
if
(
stuAssistList
!=
null
&&
stuAssistList
.
Count
>
0
)
if
(
stuAssistList
!=
null
&&
stuAssistList
.
Count
>
0
)
{
{
var
stuModel
=
studentRepository
.
GetEntity
(
StuId
);
var
stuModel
=
studentRepository
.
GetEntity
(
StuId
);
var
empModel
=
accountRepository
.
GetEmployeeInfo
(
Uid
);
var
empModel
=
accountRepository
.
GetEmployeeInfo
(
Uid
);
foreach
(
var
item
in
stuAssistList
)
foreach
(
var
item
in
stuAssistList
)
{
{
var
queryTargetWorkId
=
accountRepository
.
GetWorkUserIdRepository
(
item
.
AssistId
);
var
queryTargetWorkId
=
accountRepository
.
GetWorkUserIdRepository
(
item
.
AssistId
);
...
@@ -829,7 +948,7 @@ namespace Edu.Module.Customer
...
@@ -829,7 +948,7 @@ namespace Edu.Module.Customer
});
});
}
}
return
student_AssistRepository
.
Exists
(
list
);
return
student_AssistRepository
.
Exists
(
list
);
}
}
/// <summary>
/// <summary>
/// 推送课程顾问
/// 推送课程顾问
...
@@ -837,7 +956,7 @@ namespace Edu.Module.Customer
...
@@ -837,7 +956,7 @@ namespace Edu.Module.Customer
/// <param name="studIds"></param>
/// <param name="studIds"></param>
/// <param name="uid"></param>
/// <param name="uid"></param>
/// <returns></returns>
/// <returns></returns>
public
(
bool
result
,
string
msg
)
SetStudentAssistBatchModule
(
string
studIds
,
int
uid
)
public
(
bool
result
,
string
msg
)
SetStudentAssistBatchModule
(
string
studIds
,
int
uid
)
{
{
//语培推送配置
//语培推送配置
var
pushKey
=
"PUSH_STU_UNION_EMP"
;
var
pushKey
=
"PUSH_STU_UNION_EMP"
;
...
@@ -852,7 +971,7 @@ namespace Edu.Module.Customer
...
@@ -852,7 +971,7 @@ namespace Edu.Module.Customer
var
stuList
=
studentRepository
.
GetStudentListRepository
(
new
RB_Student_ViewModel
()
{
StuIds
=
studIds
.
TrimStart
(
','
).
TrimEnd
(
','
)
});
var
stuList
=
studentRepository
.
GetStudentListRepository
(
new
RB_Student_ViewModel
()
{
StuIds
=
studIds
.
TrimStart
(
','
).
TrimEnd
(
','
)
});
var
push
=
dicList
.
Where
(
qitem
=>
qitem
.
DictKey
==
pushKey
).
FirstOrDefault
();
var
push
=
dicList
.
Where
(
qitem
=>
qitem
.
DictKey
==
pushKey
).
FirstOrDefault
();
var
rule
=
dicList
.
Where
(
qitem
=>
qitem
.
DictKey
==
pushRule
).
FirstOrDefault
();
var
rule
=
dicList
.
Where
(
qitem
=>
qitem
.
DictKey
==
pushRule
).
FirstOrDefault
();
var
study
=
dicList
.
Where
(
qitem
=>
qitem
.
DictKey
==
studyabroad
).
FirstOrDefault
();
var
study
=
dicList
.
Where
(
qitem
=>
qitem
.
DictKey
==
studyabroad
).
FirstOrDefault
();
var
mask
=
string
.
Empty
;
var
mask
=
string
.
Empty
;
if
(
stuList
!=
null
&&
stuList
.
Count
>
0
)
if
(
stuList
!=
null
&&
stuList
.
Count
>
0
)
{
{
...
@@ -875,13 +994,13 @@ namespace Edu.Module.Customer
...
@@ -875,13 +994,13 @@ namespace Edu.Module.Customer
foreach
(
var
jItem
in
jArray
)
foreach
(
var
jItem
in
jArray
)
{
{
JObject
sObj
=
JObject
.
Parse
(
jItem
.
ToString
());
JObject
sObj
=
JObject
.
Parse
(
jItem
.
ToString
());
if
(!
isExists
&&
sObj
.
GetStringValue
(
"Code"
).
Contains
(
item
.
StuNeeds
.
ToString
()))
if
(!
isExists
&&
sObj
.
GetStringValue
(
"Code"
).
Contains
(
item
.
StuNeeds
.
ToString
()))
{
{
isExists
=
true
;
isExists
=
true
;
tempItem
=
new
RB_Dictvalue_Extend
()
tempItem
=
new
RB_Dictvalue_Extend
()
{
{
Content
=
sObj
.
GetStringValue
(
"Content"
),
Content
=
sObj
.
GetStringValue
(
"Content"
),
Mask
=
sObj
.
GetStringValue
(
"Mask"
),
Mask
=
sObj
.
GetStringValue
(
"Mask"
),
};
};
}
}
}
}
...
@@ -916,7 +1035,7 @@ namespace Edu.Module.Customer
...
@@ -916,7 +1035,7 @@ namespace Edu.Module.Customer
/// <param name="model"></param>
/// <param name="model"></param>
/// <param name="uid"></param>
/// <param name="uid"></param>
/// <returns></returns>
/// <returns></returns>
private
string
PushStudyManagerModule
(
RB_Dictvalue_Extend
study
,
RB_Student_Assist_Extend
model
,
int
uid
)
private
string
PushStudyManagerModule
(
RB_Dictvalue_Extend
study
,
RB_Student_Assist_Extend
model
,
int
uid
)
{
{
string
mask
=
""
;
string
mask
=
""
;
var
idArray
=
Common
.
ConvertHelper
.
StringToList
(
study
.
Content
);
var
idArray
=
Common
.
ConvertHelper
.
StringToList
(
study
.
Content
);
...
@@ -938,7 +1057,7 @@ namespace Edu.Module.Customer
...
@@ -938,7 +1057,7 @@ namespace Edu.Module.Customer
/// <param name="model"></param>
/// <param name="model"></param>
/// <param name="uid"></param>
/// <param name="uid"></param>
/// <param name="mask"></param>
/// <param name="mask"></param>
private
string
PushCourseManagerModule
(
RB_Dictvalue_Extend
push
,
RB_Dictvalue_Extend
rule
,
RB_Student_Assist_Extend
model
,
int
uid
)
private
string
PushCourseManagerModule
(
RB_Dictvalue_Extend
push
,
RB_Dictvalue_Extend
rule
,
RB_Student_Assist_Extend
model
,
int
uid
)
{
{
string
mask
=
""
;
string
mask
=
""
;
var
guwen
=
push
.
Content
.
Split
(
','
,
StringSplitOptions
.
RemoveEmptyEntries
);
var
guwen
=
push
.
Content
.
Split
(
','
,
StringSplitOptions
.
RemoveEmptyEntries
);
...
@@ -1378,7 +1497,8 @@ namespace Edu.Module.Customer
...
@@ -1378,7 +1497,8 @@ namespace Edu.Module.Customer
}
}
};
};
bool
flag
=
studentRepository
.
Update
(
keyValues
,
wheres
);
bool
flag
=
studentRepository
.
Update
(
keyValues
,
wheres
);
if
(
flag
)
{
if
(
flag
)
{
student_LogRepository
.
Insert
(
new
Model
.
Entity
.
Customer
.
RB_Student_Log
()
student_LogRepository
.
Insert
(
new
Model
.
Entity
.
Customer
.
RB_Student_Log
()
{
{
LogId
=
0
,
LogId
=
0
,
...
...
Edu.WebApi/Controllers/Customer/CustomerStudentController.cs
View file @
2326923c
using
Edu.Cache.User
;
using
Edu.Cache.User
;
using
Edu.Common.API
;
using
Edu.Common.API
;
using
Edu.Common.Enum.Course
;
using
Edu.Common.Enum.User
;
using
Edu.Common.Enum.User
;
using
Edu.Common.Plugin
;
using
Edu.Common.Plugin
;
using
Edu.Model.Entity.System
;
using
Edu.Model.Entity.System
;
...
@@ -184,6 +185,32 @@ namespace Edu.WebApi.Controllers.Customer
...
@@ -184,6 +185,32 @@ namespace Edu.WebApi.Controllers.Customer
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
}
/// <summary>
/// 新增修改学员跟进
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetStudentBaseInfo
()
{
var
extModel
=
new
RB_Student_Follow_Extend
()
{
Id
=
base
.
ParmJObj
.
GetInt
(
"Id"
),
StuId
=
base
.
ParmJObj
.
GetInt
(
"StuId"
),
Remark
=
base
.
ParmJObj
.
GetStringValue
(
"Remark"
),
};
string
StuProfession
=
base
.
ParmJObj
.
GetStringValue
(
"StuProfession"
);
int
StuPurpose
=
base
.
ParmJObj
.
GetInt
(
"StuPurpose"
);
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
;
bool
flag
=
customerStudentModule
.
SetStudentBaseInfoModule
(
extModel
,
StuProfession
,
StuPurpose
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// <summary>
/// 根据编号获取跟进信息
/// 根据编号获取跟进信息
/// </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