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
fcc6e899
Commit
fcc6e899
authored
Jan 11, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
f07a1611
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
133 additions
and
101 deletions
+133
-101
TenCloudCCCHelper.cs
Edu.ThirdCore/TenCloud/TenCloudCCCHelper.cs
+40
-34
QYContributeController.cs
Edu.WebApi/Controllers/QYWeChat/QYContributeController.cs
+93
-67
No files found.
Edu.ThirdCore/TenCloud/TenCloudCCCHelper.cs
View file @
fcc6e899
...
...
@@ -25,34 +25,34 @@ namespace Edu.ThirdCore.TenCloud
/// <returns></returns>
public
async
Task
<(
bool
result
,
string
message
)>
SetUserToCCCUser
(
Employee_ViewModel
employee
)
{
CreateStaffRequest
req
=
new
CreateStaffRequest
();
req
.
SdkAppId
=
SDKAPPID
;
SeatUserInfo
seatUserInfo1
=
new
SeatUserInfo
();
seatUserInfo1
.
Name
=
employee
.
EmployeeName
;
seatUserInfo1
.
Mail
=
employee
.
Email
;
seatUserInfo1
.
Phone
=
employee
.
EmployeeTel
;
seatUserInfo1
.
Nick
=
employee
.
EmployeeName
.
ToCharArray
()[
0
]
+
"老师"
;
seatUserInfo1
.
UserId
=
employee
.
Id
.
ToString
();
seatUserInfo1
.
StaffNumber
=
employee
.
Id
.
ToString
();
CreateStaffRequest
req
=
new
CreateStaffRequest
{
SdkAppId
=
SDKAPPID
};
SeatUserInfo
seatUserInfo1
=
new
SeatUserInfo
{
Name
=
employee
.
EmployeeName
,
Mail
=
employee
.
Email
,
Phone
=
employee
.
EmployeeTel
,
Nick
=
employee
.
EmployeeName
.
ToCharArray
()[
0
]
+
"老师"
,
UserId
=
employee
.
Id
.
ToString
(),
StaffNumber
=
employee
.
Id
.
ToString
()
};
req
.
Staffs
=
new
SeatUserInfo
[]
{
seatUserInfo1
};
var
credential
=
TenCloudCredential
.
_instance
;
CreateStaffResponse
resp
=
credential
.
CreateStaffSync
(
req
);
//JObject result = JObject.Parse(AbstractModel.ToJsonString(resp));
if
(
resp
.
ErrorStaffList
!=
null
&&
resp
.
ErrorStaffList
.
Length
>
0
)
if
(
resp
.
ErrorStaffList
!=
null
&&
resp
.
ErrorStaffList
.
Length
>
0
)
{
return
(
false
,
resp
.
ErrorStaffList
[
0
].
Message
);
}
else
else
{
var
groupId
=
QueryDescribeSkillGroup
();
if
(
groupId
==
null
)
{
return
(
false
,
"电话客服添加成功,但是关联技能组失败"
);
}
else
else
{
SetTenUserStaffSkillGroupList
(
employee
.
Email
,
groupId
);
}
...
...
@@ -63,10 +63,12 @@ namespace Edu.ThirdCore.TenCloud
public
void
SetTenUserStaffSkillGroupList
(
string
mail
,
long
?[]
list
)
{
var
credential
=
TenCloudCredential
.
_instance
;
BindStaffSkillGroupListRequest
req
=
new
BindStaffSkillGroupListRequest
();
req
.
SdkAppId
=
SDKAPPID
;
req
.
StaffEmail
=
mail
;
req
.
SkillGroupList
=
list
;
BindStaffSkillGroupListRequest
req
=
new
BindStaffSkillGroupListRequest
{
SdkAppId
=
SDKAPPID
,
StaffEmail
=
mail
,
SkillGroupList
=
list
};
BindStaffSkillGroupListResponse
resp
=
credential
.
BindStaffSkillGroupListSync
(
req
);
}
...
...
@@ -74,19 +76,21 @@ namespace Edu.ThirdCore.TenCloud
/// 获取技能组数组
/// </summary>
/// <returns></returns>
public
long
?[]
QueryDescribeSkillGroup
()
public
long
?[]
QueryDescribeSkillGroup
()
{
var
credential
=
TenCloudCredential
.
_instance
;
DescribeSkillGroupInfoListRequest
req
=
new
DescribeSkillGroupInfoListRequest
();
req
.
SdkAppId
=
SDKAPPID
;
req
.
PageSize
=
1
;
req
.
PageNumber
=
100
;
DescribeSkillGroupInfoListRequest
req
=
new
DescribeSkillGroupInfoListRequest
{
SdkAppId
=
SDKAPPID
,
PageSize
=
1
,
PageNumber
=
100
};
DescribeSkillGroupInfoListResponse
resp
=
credential
.
DescribeSkillGroupInfoListSync
(
req
);
if
(
resp
.
SkillGroupList
!=
null
&&
resp
.
SkillGroupList
.
Length
>
0
)
{
return
resp
.
SkillGroupList
.
Select
(
x
=>
x
.
SkillGroupId
).
ToArray
();
}
else
else
{
return
null
;
}
...
...
@@ -100,11 +104,12 @@ namespace Edu.ThirdCore.TenCloud
public
async
Task
<(
bool
result
,
string
message
)>
DelUserToCCCUser
(
Employee_ViewModel
employee
)
{
var
credential
=
TenCloudCredential
.
_instance
;
DeleteStaffRequest
req
=
new
DeleteStaffRequest
();
req
.
SdkAppId
=
SDKAPPID
;
req
.
StaffList
=
new
string
[]
{
employee
.
Email
};
DeleteStaffRequest
req
=
new
DeleteStaffRequest
{
SdkAppId
=
SDKAPPID
,
StaffList
=
new
string
[]
{
employee
.
Email
}
};
DeleteStaffResponse
resp
=
credential
.
DeleteStaffSync
(
req
);
return
(
resp
.
OnlineStaffList
==
null
,
""
);
}
...
...
@@ -116,14 +121,15 @@ namespace Edu.ThirdCore.TenCloud
{
var
credential
=
TenCloudCredential
.
_instance
;
var
tenCccTokenItem
=
new
TenCccTokenItem
();
CreateSDKLoginTokenRequest
req
=
new
CreateSDKLoginTokenRequest
();
req
.
SdkAppId
=
SDKAPPID
;
req
.
SeatUserId
=
mail
;
CreateSDKLoginTokenRequest
req
=
new
CreateSDKLoginTokenRequest
{
SdkAppId
=
SDKAPPID
,
SeatUserId
=
mail
};
CreateSDKLoginTokenResponse
resp
=
credential
.
CreateSDKLoginTokenSync
(
req
);
tenCccTokenItem
.
SdkURL
=
resp
.
SdkURL
;
tenCccTokenItem
.
Token
=
resp
.
Token
;
return
tenCccTokenItem
;
}
}
}
Edu.WebApi/Controllers/QYWeChat/QYContributeController.cs
View file @
fcc6e899
This diff is collapsed.
Click to expand it.
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