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
9f86455c
Commit
9f86455c
authored
Aug 03, 2021
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增公告相关推送
parent
a2b6745b
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
162 additions
and
14 deletions
+162
-14
PushMessageCategoryEnum.cs
Edu.Common/Enum/System/PushMessageCategoryEnum.cs
+18
-0
MessageHelper.cs
Edu.Common/Message/MessageHelper.cs
+1
-0
PushMessageModel.cs
Edu.Common/Message/PushMessageModel.cs
+6
-1
AccountModule.cs
Edu.Module.User/AccountModule.cs
+15
-6
RB_AccountRepository.cs
Edu.Repository/User/RB_AccountRepository.cs
+15
-1
ClassController.cs
Edu.WebApi/Controllers/Course/ClassController.cs
+2
-1
UserCenterController.cs
Edu.WebApi/Controllers/User/UserCenterController.cs
+104
-0
appsettings.json
Edu.WebApi/appsettings.json
+1
-5
No files found.
Edu.Common/Enum/System/PushMessageCategoryEnum.cs
View file @
9f86455c
...
...
@@ -63,5 +63,23 @@ namespace Edu.Common.Enum.System
/// </summary>
[
EnumField
(
"资产入库审核"
)]
PropertyStokcInAudit
=
9
,
/// <summary>
/// 公告审批
/// </summary>
[
EnumField
(
"公告审批"
)]
NoticeAuditTips
=
10
,
/// <summary>
/// 公告审批结果
/// </summary>
[
EnumField
(
"公告审批结果"
)]
NoticeAuditResult
=
11
,
/// <summary>
/// 公告审批结果
/// </summary>
[
EnumField
(
"公告发布"
)]
NoticePub
=
11
,
}
}
Edu.Common/Message/MessageHelper.cs
View file @
9f86455c
...
...
@@ -58,6 +58,7 @@ namespace Edu.Common.Message
message
.
CreateByName
,
message
.
MsgSign
,
message
.
MsgTemplateCode
,
message
.
WorkMsgType
,
Status
=
0
,
CreateTime
=
DateTime
.
Now
,
AppId
=
Common
.
Config
.
PushAppId
,
...
...
Edu.Common/Message/PushMessageModel.cs
View file @
9f86455c
...
...
@@ -31,7 +31,7 @@ namespace Edu.Common.Message
public
PushMessageCategoryEnum
CategoryId
{
get
;
set
;
}
/// <summary>
/// 推送平台[1-手机端,2-Web端,3-短信,4-邮件]
/// 推送平台[1-手机端,2-Web端,3-短信,4-邮件
,5-企业微信
]
/// </summary>
public
int
Platform
{
get
;
set
;
}
...
...
@@ -69,5 +69,10 @@ namespace Edu.Common.Message
/// 短信签名
/// </summary>
public
string
MsgSign
{
get
;
set
;
}
/// <summary>
/// 企业微信消息类型
/// </summary>
public
string
WorkMsgType
{
get
;
set
;
}
}
}
Edu.Module.User/AccountModule.cs
View file @
9f86455c
...
...
@@ -38,13 +38,22 @@ namespace Edu.Module.User
return
accountRepository
.
GetWorkUserIdRepository
(
id
);
}
/// <summary>
/// 获取指定部门下员工的企业号ID
/// </summary>
/// <param name="departmentIds"></param>
/// <returns></returns>
public
string
GetWorkUserIdByDepartmentModule
(
string
departmentIds
)
{
return
accountRepository
.
GetWorkUserIdByDepartmentRepository
(
departmentIds
);
}
/// <summary>
/// 获取账号列表(批量修改密码专用)
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Account_ViewModel
>
GetUpdateAccountListRepository
(
List
<
RB_Account_ViewModel
>
query
)
/// <summary>
/// 获取账号列表(批量修改密码专用)
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Account_ViewModel
>
GetUpdateAccountListRepository
(
List
<
RB_Account_ViewModel
>
query
)
{
return
accountRepository
.
GetUpdateAccountListRepository
(
query
);
}
...
...
Edu.Repository/User/RB_AccountRepository.cs
View file @
9f86455c
...
...
@@ -640,7 +640,21 @@ WHERE e.RB_Group_id ={GroupId} AND e.IsLeave =0 AND o.Score =0 GROUP BY e.Employ
var
result
=
ExecuteScalar
(
sql
,
null
);
return
Convert
.
IsDBNull
(
result
)
&&
!
result
.
Equals
(
null
)
?
string
.
Empty
:
result
.
ToString
();
return
!
result
.
Equals
(
null
)&&
Convert
.
IsDBNull
(
result
)
?
string
.
Empty
:
result
.
ToString
();
}
/// <summary>
/// 获取指定部门下员工的企业号ID
/// </summary>
/// <param name="departmentIds"></param>
/// <returns></returns>
public
string
GetWorkUserIdByDepartmentRepository
(
string
departmentIds
)
{
string
sql
=
$"select GROUP_CONCAT(WorkUserId SEPARATOR '|') from rb_employee where RB_Department_Id in(
{
departmentIds
}
)"
;
var
result
=
ExecuteScalar
(
sql
,
null
);
return
!
result
.
Equals
(
null
)
&&
Convert
.
IsDBNull
(
result
)
?
string
.
Empty
:
result
.
ToString
();
}
}
}
\ No newline at end of file
Edu.WebApi/Controllers/Course/ClassController.cs
View file @
9f86455c
...
...
@@ -2182,7 +2182,8 @@ namespace Edu.WebApi.Controllers.Course
Content
=
markdownContent
,
CoverImg
=
""
,
CreateByName
=
base
.
UserInfo
.
AccountName
,
JumpUrl
=
"markdown"
,
JumpUrl
=
""
,
WorkMsgType
=
"markdown"
,
SendTime
=
DateTime
.
Now
,
SendType
=
0
,
Title
=
"主管评论备课通知"
,
...
...
Edu.WebApi/Controllers/User/UserCenterController.cs
View file @
9f86455c
...
...
@@ -3,10 +3,12 @@ using System.Collections.Generic;
using
System.Data
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
System.Web
;
using
Edu.AOP
;
using
Edu.Cache.User
;
using
Edu.Common
;
using
Edu.Common.API
;
using
Edu.Common.Enum.System
;
using
Edu.Common.Enum.User
;
using
Edu.Common.Plugin
;
using
Edu.Model.CacheModel
;
...
...
@@ -14,6 +16,7 @@ using Edu.Model.Public;
using
Edu.Model.ViewModel.User
;
using
Edu.Module.User
;
using
Edu.WebApi.Filter
;
using
Microsoft.AspNetCore.Authorization
;
using
Microsoft.AspNetCore.Cors
;
using
Microsoft.AspNetCore.Mvc
;
using
Newtonsoft.Json
;
...
...
@@ -49,6 +52,11 @@ namespace Edu.WebApi.Controllers.User
/// </summary>
private
readonly
DepartmentModule
departmentModule
=
new
DepartmentModule
();
/// <summary>
/// 账户对象
/// </summary>
private
readonly
AccountModule
accountModule
=
new
AccountModule
();
#
region
字典管理
/// <summary>
...
...
@@ -240,6 +248,7 @@ namespace Edu.WebApi.Controllers.User
/// </summary>
/// <returns></returns>
[
HttpPost
]
[
AllowAnonymous
]
public
ApiResult
GetNoticeInfo
()
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
...
...
@@ -311,6 +320,35 @@ namespace Edu.WebApi.Controllers.User
bool
flag
=
noticeModule
.
SetNoticeInfo
(
demodel
);
if
(
flag
)
{
var
modelShenhe
=
attendancemodule
.
GetDictValueList
(
userInfo
.
Group_Id
,
Config
.
Notice_BaseKey
).
FirstOrDefault
();
if
(
modelShenhe
!=
null
&&
!
string
.
IsNullOrEmpty
(
modelShenhe
.
Content
))
{
var
queryTargetWorkId
=
accountModule
.
GetWorkUserIdModule
(
int
.
Parse
(
modelShenhe
.
Content
));
//添加推送信息
if
(!
string
.
IsNullOrEmpty
(
queryTargetWorkId
))
{
var
path
=
$"/administration/documentApproval"
;
path
=
HttpUtility
.
UrlEncode
(
path
);
string
markdownContent
=
$"##### 你有新的待审批公告 \n>**概要信息** \n>公告标题:
{
demodel
.
Title
}
</font>\n>发 布 人:
{
userInfo
.
AccountName
}
\n>提审时间:<font color='comment'>
{
DateTime
.
Now
.
ToString
(
"MM-dd HH:mm"
)}
</font>\n>\n>接收对象:<font color='info'>
{(
demodel
.
To
==
"-1"
?
"全公司"
:
"指定部门"
)}
</font>\n>请 点 击:[立即审批](
{
Config
.
ErpUrl
}
/autologin?loginId=
{
modelShenhe
.
Content
}
&target=
{
path
}
#target=out)"
;
Common
.
Message
.
PushMessageModel
modelWork
=
new
Common
.
Message
.
PushMessageModel
()
{
CategoryId
=
PushMessageCategoryEnum
.
NoticeAuditTips
,
Content
=
markdownContent
,
CoverImg
=
""
,
CreateByName
=
base
.
UserInfo
.
AccountName
,
JumpUrl
=
""
,
WorkMsgType
=
"markdown"
,
SendTime
=
DateTime
.
Now
,
SendType
=
0
,
Title
=
"公告审批提醒"
,
Platform
=
5
,
ReceiveId
=
queryTargetWorkId
};
Common
.
Message
.
MessageHelper
.
SendMessage
(
modelWork
);
}
}
return
ApiResult
.
Success
();
}
else
...
...
@@ -412,6 +450,72 @@ namespace Edu.WebApi.Controllers.User
bool
flag
=
noticeModule
.
UpdateNotice
(
oldModel
,
noticeLogModel
);
if
(
flag
)
{
var
noticeModel
=
noticeModule
.
GetNoticeEntity
(
NoticeId
);
if
(
noticeModel
!=
null
)
{
var
queryTargetWorkId
=
accountModule
.
GetWorkUserIdModule
(
noticeModel
.
CreateBy
);
#
region
推送审批消息给用户
if
(!
string
.
IsNullOrEmpty
(
queryTargetWorkId
))
{
var
path
=
$"/noticeView?NoticeId=
{
NoticeId
}
"
;
if
(
ReviewStatus
==
2
)
{
path
=
$"/administration/document"
;
}
path
=
HttpUtility
.
UrlEncode
(
path
);
string
markdownContent
=
$"<font color='
{(
ReviewStatus
==
2
?
"warning"
:
"info"
)}
'>`审批
{(
ReviewStatus
==
1
?
"通过"
:
"驳回"
)}
`</font> 公告审批结果\n\n>**概要信息** \n>公告标题:
{
noticeModel
.
Title
}
\n>审 核 人:
{
userInfo
.
AccountName
}
\n>审核时间:<font color='comment'>
{
DateTime
.
Now
.
ToString
(
"MM-dd HH:mm"
)}
</font>\n>\n>请 点 击:[查看详情](
{
Config
.
ErpUrl
}
/autologin?loginId=
{
noticeModel
.
CreateBy
}
&target=
{
path
}
#target=out)"
;
Common
.
Message
.
PushMessageModel
modelWork
=
new
Common
.
Message
.
PushMessageModel
()
{
CategoryId
=
PushMessageCategoryEnum
.
NoticeAuditResult
,
Content
=
markdownContent
,
CoverImg
=
""
,
CreateByName
=
base
.
UserInfo
.
AccountName
,
JumpUrl
=
""
,
WorkMsgType
=
"markdown"
,
SendTime
=
DateTime
.
Now
,
SendType
=
0
,
Title
=
"公告审批提醒"
,
Platform
=
5
,
ReceiveId
=
queryTargetWorkId
};
Common
.
Message
.
MessageHelper
.
SendMessage
(
modelWork
);
}
#
endregion
#
region
批量推送公告用户
if
(
ReviewStatus
==
1
)
{
var
to
=
"@all"
;
if
(
noticeModel
.
To
!=
"-1"
)
{
to
=
accountModule
.
GetWorkUserIdByDepartmentModule
(
noticeModel
.
To
);
}
if
(!
string
.
IsNullOrEmpty
(
to
))
{
Common
.
Message
.
PushMessageModel
modelPubWork
=
new
Common
.
Message
.
PushMessageModel
()
{
CategoryId
=
PushMessageCategoryEnum
.
NoticePub
,
Content
=
noticeModel
.
Content
,
CoverImg
=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1627978081000_321.jpg"
,
CreateByName
=
base
.
UserInfo
.
AccountName
,
JumpUrl
=
$"
{
Config
.
ErpUrl
}
/noticeView?NoticeId=
{
NoticeId
}
"
,
WorkMsgType
=
"news"
,
SendTime
=
DateTime
.
Now
,
SendType
=
0
,
Title
=
noticeModel
.
Title
,
Platform
=
5
,
ReceiveId
=
to
};
Common
.
Message
.
MessageHelper
.
SendMessage
(
modelPubWork
);
}
}
#
endregion
}
return
ApiResult
.
Success
();
}
else
...
...
Edu.WebApi/appsettings.json
View file @
9f86455c
...
...
@@ -92,11 +92,7 @@
//订单转班流程编号
"OrderTransClassFlowId"
:
5
,
//订单分拆流程编号
<<<<<<<
HEAD
"OrderSplitClassFlowId"
:
6
=======
"OrderSplitClassFlowId"
:
6
,
//是否开启调课数据验证
"IsOpenChangeClassVerify"
:
1
,
>>>>>>>
fb
5
d
4
f
946
a
291685
b
92721
a
6797705
cd
4780
dffe
"IsOpenChangeClassVerify"
:
1
}
\ No newline at end of file
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