Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gs1-office-web-sit
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴迪
gs1-office-web-sit
Commits
260a8bd5
Commit
260a8bd5
authored
Jan 11, 2022
by
rongkailun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【新增】公告通知修改、删除、审核
parent
49890b63
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
14 deletions
+61
-14
AnnounceController.java
.../office/modules/manage/controller/AnnounceController.java
+31
-14
AnnounceService.java
...ava/io/office/modules/manage/service/AnnounceService.java
+6
-0
AnnounceServiceImpl.java
...fice/modules/manage/service/impl/AnnounceServiceImpl.java
+24
-0
No files found.
src/main/java/io/office/modules/manage/controller/AnnounceController.java
View file @
260a8bd5
package
io
.
office
.
modules
.
manage
.
controller
;
package
io
.
office
.
modules
.
manage
.
controller
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.modules.manage.entity.GlossaryEntity
;
import
io.office.modules.manage.entity.NewsEntity
;
import
io.office.modules.manage.entity.NewsEntity
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.sys.controller.AbstractController
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
io.office.modules.manage.entity.AnnounceEntity
;
import
io.office.modules.manage.entity.AnnounceEntity
;
import
io.office.modules.manage.service.AnnounceService
;
import
io.office.modules.manage.service.AnnounceService
;
...
@@ -30,7 +31,7 @@ import io.office.common.utils.R;
...
@@ -30,7 +31,7 @@ import io.office.common.utils.R;
*/
*/
@RestController
@RestController
@RequestMapping
(
"/announce"
)
@RequestMapping
(
"/announce"
)
public
class
AnnounceController
{
public
class
AnnounceController
extends
AbstractController
{
@Autowired
@Autowired
private
AnnounceService
announceService
;
private
AnnounceService
announceService
;
...
@@ -70,9 +71,8 @@ public class AnnounceController {
...
@@ -70,9 +71,8 @@ public class AnnounceController {
@RequestMapping
(
"/save"
)
@RequestMapping
(
"/save"
)
// @RequiresPermissions("manage:announce:save")
// @RequiresPermissions("manage:announce:save")
public
R
save
(
@RequestBody
AnnounceEntity
announce
){
public
R
save
(
@RequestBody
AnnounceEntity
announce
){
announceService
.
save
(
announce
);
announceService
.
insertAnnounce
(
announce
,
getUser
());
return
R
.
ok
(
"新增成功!"
);
return
R
.
ok
();
}
}
/**
/**
...
@@ -81,9 +81,10 @@ public class AnnounceController {
...
@@ -81,9 +81,10 @@ public class AnnounceController {
@RequestMapping
(
"/update"
)
@RequestMapping
(
"/update"
)
// @RequiresPermissions("manage:announce:update")
// @RequiresPermissions("manage:announce:update")
public
R
update
(
@RequestBody
AnnounceEntity
announce
){
public
R
update
(
@RequestBody
AnnounceEntity
announce
){
announce
.
setEditor
(
getUser
().
getUsername
());
announce
.
setUpdatedate
(
new
Date
());
announceService
.
updateById
(
announce
);
announceService
.
updateById
(
announce
);
return
R
.
ok
(
"修改成功!"
);
return
R
.
ok
();
}
}
/**
/**
...
@@ -91,10 +92,26 @@ public class AnnounceController {
...
@@ -91,10 +92,26 @@ public class AnnounceController {
*/
*/
@RequestMapping
(
"/delete"
)
@RequestMapping
(
"/delete"
)
// @RequiresPermissions("manage:announce:delete")
// @RequiresPermissions("manage:announce:delete")
public
R
delete
(
@RequestBody
Integer
[]
ids
){
public
R
delete
(
@RequestBody
List
<
String
>
ids
){
announceService
.
removeByIds
(
Arrays
.
asList
(
ids
));
AnnounceEntity
announce
=
new
AnnounceEntity
();
announce
.
setEditor
(
getUser
().
getUsername
());
announce
.
setUpdatedate
(
new
Date
());
announce
.
setLevels
(
0
);
QueryWrapper
<
AnnounceEntity
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
in
(
"id"
,
ids
);
announceService
.
update
(
announce
,
queryWrapper
);
return
R
.
ok
(
"删除成功!"
);
}
return
R
.
ok
();
/**
* 审核
*/
@PostMapping
(
"/verify"
)
// @RequiresPermissions("manage:news:verify")
public
R
verify
(
@RequestBody
AnnounceEntity
announce
)
{
R
r
=
this
.
announceService
.
verify
(
announce
,
getUser
());
return
R
.
ok
(
"审核成功!"
);
}
}
}
}
src/main/java/io/office/modules/manage/service/AnnounceService.java
View file @
260a8bd5
...
@@ -3,8 +3,10 @@ package io.office.modules.manage.service;
...
@@ -3,8 +3,10 @@ package io.office.modules.manage.service;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.R
;
import
io.office.modules.manage.entity.AnnounceEntity
;
import
io.office.modules.manage.entity.AnnounceEntity
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.sys.entity.SysUserEntity
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -20,5 +22,9 @@ public interface AnnounceService extends IService<AnnounceEntity> {
...
@@ -20,5 +22,9 @@ public interface AnnounceService extends IService<AnnounceEntity> {
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
);
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
);
Page
<
AnnounceEntity
>
selectAnnounceList
(
NewsParams
newsParams
,
Page
page
);
Page
<
AnnounceEntity
>
selectAnnounceList
(
NewsParams
newsParams
,
Page
page
);
void
insertAnnounce
(
AnnounceEntity
announce
,
SysUserEntity
user
);
R
verify
(
AnnounceEntity
announce
,
SysUserEntity
user
);
}
}
src/main/java/io/office/modules/manage/service/impl/AnnounceServiceImpl.java
View file @
260a8bd5
package
io
.
office
.
modules
.
manage
.
service
.
impl
;
package
io
.
office
.
modules
.
manage
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.common.utils.R
;
import
io.office.modules.manage.entity.NewsEntity
;
import
io.office.modules.manage.entity.NewsEntity
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.sys.entity.SysUserEntity
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
...
@@ -42,4 +45,24 @@ public class AnnounceServiceImpl extends ServiceImpl<AnnounceDao, AnnounceEntity
...
@@ -42,4 +45,24 @@ public class AnnounceServiceImpl extends ServiceImpl<AnnounceDao, AnnounceEntity
return
page
;
return
page
;
}
}
@Override
public
void
insertAnnounce
(
AnnounceEntity
announce
,
SysUserEntity
user
)
{
announce
.
setReleasedate
(
new
Date
());
announce
.
setUpdatedate
(
new
Date
());
announce
.
setEditor
(
user
.
getUsername
());
announce
.
setStatus
(
0
);
this
.
baseMapper
.
insert
(
announce
);
}
@Override
public
R
verify
(
AnnounceEntity
announce
,
SysUserEntity
user
)
{
announce
.
setUpdatedate
(
new
Date
());
announce
.
setEditor
(
user
.
getUsername
());
announce
.
setAuditor
(
user
.
getUsername
());
QueryWrapper
<
AnnounceEntity
>
newsEntityQueryWrapper
=
new
QueryWrapper
<>();
newsEntityQueryWrapper
.
eq
(
"id"
,
announce
.
getId
());
announceDao
.
update
(
announce
,
newsEntityQueryWrapper
);
return
null
;
}
}
}
\ 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