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
a5cc0efc
Commit
a5cc0efc
authored
Nov 02, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
1634afe0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
10 deletions
+49
-10
ContributeConfigTypeEnum.cs
Edu.Common/Enum/WeChat/ContributeConfigTypeEnum.cs
+6
-1
QYContributeModule.cs
Edu.Module.QYWeChat/QYContributeModule.cs
+39
-9
RB_Contribute_InfoRepository.cs
Edu.Repository/WeChat/RB_Contribute_InfoRepository.cs
+4
-0
No files found.
Edu.Common/Enum/WeChat/ContributeConfigTypeEnum.cs
View file @
a5cc0efc
...
...
@@ -14,6 +14,11 @@ namespace Edu.Common.Enum.WeChat
/// 公众订阅号
/// </summary>
[
EnumField
(
"公众订阅号"
)]
Subscription
=
1
Subscription
=
1
,
/// <summary>
/// 其他
/// </summary>
[
EnumField
(
"其他"
)]
Other
=
2
}
}
Edu.Module.QYWeChat/QYContributeModule.cs
View file @
a5cc0efc
...
...
@@ -1310,18 +1310,22 @@ namespace Edu.Module.QYWeChat
PublishLogId
=
pmodel
.
Id
;
}
}
else
if
(
model
.
Type
==
ContributeInfoTypeEnum
.
Image
)
{
else
if
(
model
.
Type
==
ContributeInfoTypeEnum
.
Image
)
{
//图片 自己写推送方法 盛派不支持多图片
var
mediumList
=
contribute_MediumRepository
.
GetList
(
new
RB_Contribute_Medium_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
MediumIds
=
model
.
ImageMediumIds
});
List
<
int
>
midsList
=
JsonHelper
.
DeserializeObject
<
List
<
int
>>(
"["
+
model
.
ImageMediumIds
+
"]"
);
List
<
string
>
wxMediaId
=
new
List
<
string
>();
foreach
(
var
item
in
midsList
)
{
foreach
(
var
item
in
midsList
)
{
string
mediaId
=
mediumList
.
Where
(
x
=>
x
.
Id
==
item
).
FirstOrDefault
()?.
Media_Id
??
""
;
if
(!
string
.
IsNullOrEmpty
(
mediaId
))
{
if
(!
string
.
IsNullOrEmpty
(
mediaId
))
{
wxMediaId
.
Add
(
mediaId
);
}
}
if
(
wxMediaId
.
Any
())
{
if
(
wxMediaId
.
Any
())
{
var
pmodel
=
contribute_PublishLogRepository
.
GetList
(
new
RB_Contribute_PublishLog_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
ContributeId
=
contributeId
,
PlatfromId
=
(
ContributeConfigTypeEnum
)
platformId
}).
FirstOrDefault
();
if
(
pmodel
==
null
)
{
...
...
@@ -1360,7 +1364,8 @@ namespace Edu.Module.QYWeChat
return
"推送失败,请联系管理员"
;
}
}
else
if
(
IsPreview
==
2
)
{
//群发
else
if
(
IsPreview
==
2
)
{
//群发
var
Rmsg
=
GZHWeChatHelper
.
SendImageMessageByTagId
(
token
,
tagId
,
wxMediaId
,
model
.
Description
,
string
.
IsNullOrEmpty
(
tagId
)
?
true
:
false
);
if
(
Rmsg
!=
null
&&
Rmsg
.
errcode
==
Senparc
.
Weixin
.
ReturnCode
.
请求成功
)
{
...
...
@@ -1391,7 +1396,8 @@ namespace Edu.Module.QYWeChat
}
}
if
(!
string
.
IsNullOrEmpty
(
Media_Id
))
{
if
(!
string
.
IsNullOrEmpty
(
Media_Id
))
{
//开始群发推送
try
{
...
...
@@ -1411,13 +1417,15 @@ namespace Edu.Module.QYWeChat
return
"推送失败,请联系管理员"
;
}
}
else
if
(
IsPreview
==
2
)
{
else
if
(
IsPreview
==
2
)
{
//群发
var
Rmsg
=
GZHWeChatHelper
.
SendGroupMessageByTagId
(
token
,
tagId
,
Media_Id
,
PType
,
string
.
IsNullOrEmpty
(
tagId
)
?
true
:
false
);
if
(
Rmsg
.
errcode
==
Senparc
.
Weixin
.
ReturnCode
.
请求成功
)
{
//推送OK 需要记录推送的 Msg_Id 以后用作查询使用
if
(
PublishLogId
>
0
)
{
if
(
PublishLogId
>
0
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Contribute_PublishLog_ViewModel
.
Msg_Id
),
Rmsg
.
msg_id
},
{
nameof
(
RB_Contribute_PublishLog_ViewModel
.
Msg_Data_Id
),
Rmsg
.
msg_data_id
},
...
...
@@ -1447,7 +1455,29 @@ namespace Edu.Module.QYWeChat
}
}
}
else
{
else
if
(
configModel
.
Type
==
ContributeConfigTypeEnum
.
Other
)
{
//查询该平台是否已发布过
var
pmodel
=
contribute_PublishLogRepository
.
GetList
(
new
RB_Contribute_PublishLog_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
ContributeId
=
contributeId
,
PlatfromId
=
(
ContributeConfigTypeEnum
)
platformId
}).
FirstOrDefault
();
if
(
pmodel
==
null
)
{
contribute_PublishLogRepository
.
Insert
(
new
Model
.
Entity
.
WeChat
.
RB_Contribute_PublishLog
()
{
Id
=
0
,
Content
=
"发布其他平台"
,
ContributeId
=
contributeId
,
CreateBy
=
userInfo
.
Id
,
CreateTime
=
DateTime
.
Now
,
Group_Id
=
userInfo
.
Group_Id
,
Media_Id
=
""
,
PlatfromId
=
configModel
.
Type
,
Status
=
0
,
UpdateBy
=
userInfo
.
Id
,
UpdateTime
=
DateTime
.
Now
});
}
}
else
{
return
"该平台未开通"
;
}
return
""
;
...
...
Edu.Repository/WeChat/RB_Contribute_InfoRepository.cs
View file @
a5cc0efc
...
...
@@ -30,6 +30,10 @@ namespace Edu.Repository.WeChat
{
where
+=
$@" and r.
{
nameof
(
RB_Contribute_Info_ViewModel
.
Group_Id
)}
=
{
demodel
.
Group_Id
}
"
;
}
if
(
demodel
.
CreateBy
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Contribute_Info_ViewModel
.
CreateBy
)}
=
{
demodel
.
CreateBy
}
"
;
}
if
(
demodel
.
MediaState
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Contribute_Info_ViewModel
.
MediaState
)}
=
{
demodel
.
MediaState
}
"
;
...
...
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