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
8f5363e5
Commit
8f5363e5
authored
Jan 12, 2022
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整流程
parent
381765f3
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
177 additions
and
3 deletions
+177
-3
CustomerRedisCache.cs
Edu.Cache/Customer/CustomerRedisCache.cs
+61
-0
CustomerStudentModule.cs
Edu.Module.Customer/CustomerStudentModule.cs
+84
-0
StudentModule.cs
Edu.Module.User/StudentModule.cs
+2
-0
CustomerStudentController.cs
Edu.WebApi/Controllers/Customer/CustomerStudentController.cs
+12
-1
UserController.cs
Edu.WebApi/Controllers/User/UserController.cs
+18
-2
No files found.
Edu.Cache/Customer/CustomerRedisCache.cs
0 → 100644
View file @
8f5363e5
using
Edu.CacheManager.Base
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Edu.Cache.Customer
{
public
class
CustomerRedisCache
{
/// <summary>
/// 使用redis第几号库
/// </summary>
public
static
readonly
int
REDIS_DB3
=
3
;
static
readonly
RedisHelper
redis
=
new
RedisHelper
(
REDIS_DB3
);
static
readonly
string
DISTRIBUTION_RULE_KEY
=
"DISTRIBUTION_CURSOR"
;
static
readonly
object
LOCKER
=
new
object
();
static
readonly
object
LOCKED
=
new
object
();
public
static
void
Set
(
object
Data
)
{
lock
(
LOCKER
)
{
lock
(
LOCKED
)
{
try
{
redis
.
StringSet
(
DISTRIBUTION_RULE_KEY
,
Data
);
}
catch
(
Exception
)
{
}
}
}
}
public
static
int
Get
()
{
lock
(
LOCKER
)
{
lock
(
LOCKED
)
{
try
{
var
info
=
redis
.
StringGet
<
int
>(
DISTRIBUTION_RULE_KEY
);
//默认往后移动一位
redis
.
StringSet
(
DISTRIBUTION_RULE_KEY
,
(
info
+
1
));
return
info
;
}
catch
(
Exception
)
{
return
0
;
}
}
}
}
}
}
Edu.Module.Customer/CustomerStudentModule.cs
View file @
8f5363e5
...
...
@@ -12,6 +12,7 @@ using Edu.Common.Plugin;
using
Edu.Repository.System
;
using
Edu.Model.Entity.System
;
using
Edu.Model.ViewModel.System
;
using
Edu.Cache.Customer
;
namespace
Edu.Module.Customer
{
...
...
@@ -85,6 +86,8 @@ namespace Edu.Module.Customer
/// </summary>
private
readonly
RB_NeedsRepository
needsRepository
=
new
RB_NeedsRepository
();
private
readonly
Rb_dictvalueRepository
dictvalueRepository
=
new
Rb_dictvalueRepository
();
#
region
学员约访
...
...
@@ -691,6 +694,87 @@ namespace Edu.Module.Customer
return
student_AssistRepository
.
Exists
(
list
);
}
public
(
bool
result
,
string
msg
)
SetStudentAssistBatchModule
(
string
studIds
,
int
uid
)
{
var
tempList
=
studIds
.
Split
(
','
,
StringSplitOptions
.
RemoveEmptyEntries
);
var
pushKey
=
"PUSH_STU_UNION_EMP"
;
var
pushRule
=
"PUSH_STU_RULETYPE"
;
if
(
tempList
.
Length
>
0
)
{
var
push
=
dictvalueRepository
.
GetList
(
new
RB_Dictvalue_Extend
()
{
DictKey
=
pushKey
}).
FirstOrDefault
();
var
rule
=
dictvalueRepository
.
GetList
(
new
RB_Dictvalue_Extend
()
{
DictKey
=
pushRule
}).
FirstOrDefault
();
var
guwen
=
push
.
Content
.
Split
(
','
,
StringSplitOptions
.
RemoveEmptyEntries
);
var
guwenName
=
push
.
Mask
.
Split
(
','
,
StringSplitOptions
.
RemoveEmptyEntries
);
if
(
guwen
.
Length
>
1
)
{
if
(
rule
.
Content
.
Equals
(
"1"
))
{
var
mask
=
string
.
Empty
;
tempList
.
ToList
().
ForEach
(
x
=>
{
Random
ran
=
new
Random
();
var
cur
=
ran
.
Next
(
0
,
guwen
.
Length
-
1
);
var
model
=
new
RB_Student_Assist_Extend
()
{
Id
=
0
,
AssistId
=
int
.
Parse
(
guwen
[
cur
]),
AssistType
=
Common
.
Enum
.
User
.
AssistTypeEnum
.
CourseAdviser
,
StuId
=
int
.
Parse
(
x
),
Status
=
Common
.
Enum
.
DateStateEnum
.
Normal
};
SetStudentAssistModule
(
int
.
Parse
(
x
),
model
,
uid
);
mask
+=
mask
.
Contains
(
","
+
guwenName
[
cur
])
?
""
:
","
+
guwenName
[
cur
];
});
return
(
true
,
"学员批量转课程顾问成功,已分别转给顾问:"
+
mask
);
}
else
{
var
mask
=
string
.
Empty
;
tempList
.
ToList
().
ForEach
(
x
=>
{
var
cache
=
CustomerRedisCache
.
Get
();
if
(
cache
>=
guwen
.
Length
)
{
CustomerRedisCache
.
Set
(
1
);
cache
=
0
;
}
var
model
=
new
RB_Student_Assist_Extend
()
{
Id
=
0
,
AssistId
=
int
.
Parse
(
guwen
[
cache
]),
AssistType
=
Common
.
Enum
.
User
.
AssistTypeEnum
.
CourseAdviser
,
StuId
=
int
.
Parse
(
x
),
Status
=
Common
.
Enum
.
DateStateEnum
.
Normal
};
SetStudentAssistModule
(
int
.
Parse
(
x
),
model
,
uid
);
mask
+=
mask
.
Contains
(
","
+
guwenName
[
cache
])
?
""
:
","
+
guwenName
[
cache
];
});
return
(
true
,
"学员批量转课程顾问成功,已分别转给顾问:"
+
mask
);
}
}
else
{
tempList
.
ToList
().
ForEach
(
x
=>
{
var
model
=
new
RB_Student_Assist_Extend
()
{
Id
=
0
,
AssistId
=
int
.
Parse
(
guwen
[
0
]),
AssistType
=
Common
.
Enum
.
User
.
AssistTypeEnum
.
CourseAdviser
,
StuId
=
int
.
Parse
(
x
),
Status
=
Common
.
Enum
.
DateStateEnum
.
Normal
};
SetStudentAssistModule
(
int
.
Parse
(
x
),
model
,
uid
);
});
return
(
true
,
"学员批量转课程顾问成功,已全部转给顾问:"
+
push
.
Mask
);
}
}
else
{
return
(
false
,
"未获取到学员信息"
);
}
}
/// <summary>
/// 获取学员协助人员列表
/// </summary>
...
...
Edu.Module.User/StudentModule.cs
View file @
8f5363e5
...
...
@@ -376,7 +376,9 @@ namespace Edu.Module.User
Common
.
Message
.
MessageHelper
.
SendMessage
(
modelWork
);
}
}
}
return
flag
;
}
...
...
Edu.WebApi/Controllers/Customer/CustomerStudentController.cs
View file @
8f5363e5
...
...
@@ -450,7 +450,7 @@ namespace Edu.WebApi.Controllers.Customer
[
HttpPost
]
public
ApiResult
SetStudentAssist
()
{
var
AssistList
=
new
List
<
RB_Student_Assist_Extend
>();
//
var AssistList = new List<RB_Student_Assist_Extend>();
var
StuId
=
base
.
ParmJObj
.
GetInt
(
"StuId"
);
var
model
=
new
RB_Student_Assist_Extend
()
{
...
...
@@ -468,6 +468,17 @@ namespace Edu.WebApi.Controllers.Customer
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 批量添加课程顾问
/// </summary>
/// <returns></returns>
public
ApiResult
SetStudentAssistBatch
()
{
var
stuIds
=
base
.
ParmJObj
.
GetStringValue
(
"stuIds"
);
var
result
=
customerStudentModule
.
SetStudentAssistBatchModule
(
stuIds
,
base
.
UserInfo
.
Id
);
return
result
.
result
?
ApiResult
.
Success
(
message
:
result
.
msg
)
:
ApiResult
.
Failed
(
message
:
result
.
msg
);
}
/// <summary>
/// 删除协同人员
/// </summary>
...
...
Edu.WebApi/Controllers/User/UserController.cs
View file @
8f5363e5
...
...
@@ -868,8 +868,24 @@ namespace Edu.WebApi.Controllers.User
{
return
ApiResult
.
Failed
(
"此学员微信号已绑定同行!请重新录入!"
);
}
var
isInsert
=
extModel
.
StuId
==
0
;
bool
flag
=
studentModule
.
SetStudentModule
(
extModel
);
if
(
flag
&&
isInsert
)
{
if
(
base
.
UserInfo
.
IsCourseConsultant
==
1
)
{
//课程顾问创建学员,默认写入顾问信息
var
assistModel
=
new
RB_Student_Assist_Extend
()
{
Id
=
0
,
AssistId
=
base
.
UserInfo
.
Id
,
AssistType
=
Common
.
Enum
.
User
.
AssistTypeEnum
.
CourseAdviser
,
StuId
=
extModel
.
StuId
,
Status
=
Common
.
Enum
.
DateStateEnum
.
Normal
};
new
CustomerStudentModule
().
SetStudentAssistModule
(
extModel
.
StuId
,
assistModel
,
base
.
UserInfo
.
Id
);
}
}
return
flag
?
ApiResult
.
Success
(
data
:
extModel
)
:
ApiResult
.
Failed
();
}
...
...
@@ -1109,7 +1125,7 @@ namespace Edu.WebApi.Controllers.User
{
return
ApiResult
.
Failed
(
"此学员微信号已绑定同行!请重新录入!"
);
}
bool
flag
=
studentModule
.
SetStudentModule
(
extModel
,
1
);
bool
flag
=
studentModule
.
SetStudentModule
(
extModel
,
fromApp
:
1
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
...
...
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