Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
c4fba3b0
Commit
c4fba3b0
authored
Jul 13, 2020
by
sxy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 发布系统公告
parent
534856a0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
4 deletions
+33
-4
center-manage/app/base/controller/impl/msg/msgCtl.js
+22
-0
center-manage/app/base/service/impl/msg/msgSve.js
+11
-4
No files found.
center-manage/app/base/controller/impl/msg/msgCtl.js
View file @
c4fba3b0
...
...
@@ -72,6 +72,28 @@ class MsgCtl extends CtlBase {
}
}
async
createSysMessage
(
pobj
,
qobj
,
req
)
{
if
(
!
pobj
.
title
)
{
return
system
.
getResult
(
null
,
"title can not be empty,100290"
);
}
if
(
!
pobj
.
content
)
{
return
system
.
getResult
(
null
,
"content can not be empty,100290"
);
}
try
{
const
rs
=
await
this
.
service
.
create
({
...
pobj
,
msgType
:
system
.
Msg
.
SYS
,
sender
:
pobj
.
username
,
sender_id
:
pobj
.
userid
,
company_id
:
pobj
.
company_id
},
qobj
,
req
);
return
system
.
getResult
(
rs
);
}
catch
(
err
)
{
return
system
.
getResult
(
null
,
err
.
message
)
}
}
/**
* 返回未提醒 消息
* @param {*} pobj
...
...
center-manage/app/base/service/impl/msg/msgSve.js
View file @
c4fba3b0
...
...
@@ -11,7 +11,7 @@ class MsgService extends ServiceBase {
async
create
(
pobj
,
qobj
,
req
)
{
let
{
msgType
,
app_id
,
app_key
,
sender
,
sender_id
,
title
,
content
,
jump_address
,
other
,
target
content
,
jump_address
,
other
,
target
,
company_id
}
=
pobj
;
let
msg
=
{
...
...
@@ -23,7 +23,8 @@ class MsgService extends ServiceBase {
title
,
content
,
jump_address
,
other
other
,
company_id
}
return
this
.
db
.
transaction
(
async
(
t
)
=>
{
const
msgData
=
await
this
.
dao
.
create
(
msg
,
t
);
...
...
@@ -110,11 +111,14 @@ class MsgService extends ServiceBase {
}
async
findSystemMsgCount
(
pobj
,
qobj
,
req
)
{
let
{
type
}
=
pobj
;
let
{
type
,
company_id
}
=
pobj
;
let
where
=
{
msgType
:
system
.
Msg
.
SYS
,
is_undo
:
false
,
company_id
:
{
$in
:
[
1
,
company_id
]
}
}
if
(
type
===
"recently"
)
{
// 查询 三天内的
...
...
@@ -146,7 +150,7 @@ class MsgService extends ServiceBase {
}
async
list
(
pobj
,
qobj
,
req
)
{
let
{
userid
,
msgType
,
pageSize
=
10
,
pageNo
=
1
}
=
pobj
;
let
{
userid
,
msgType
,
pageSize
=
10
,
pageNo
=
1
,
company_id
}
=
pobj
;
let
msgData
=
[];
let
other
=
{
limit
:
pageSize
,
...
...
@@ -170,6 +174,9 @@ class MsgService extends ServiceBase {
msgData
=
await
this
.
dao
.
findAll
({
msgType
:
system
.
Msg
.
SYS
,
is_undo
:
false
,
company_id
:
{
$in
:
[
1
,
company_id
]
}
},
[],
other
);
msgData
=
msgData
.
map
(
item
=>
{
return
{
...
...
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