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
4201b6ce
Commit
4201b6ce
authored
Nov 13, 2021
by
rongkailun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【新增】政策法规新增修改删除审核
parent
48484d07
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
16 deletions
+62
-16
PolicyController.java
...io/office/modules/manage/controller/PolicyController.java
+25
-12
PolicyEntity.java
...in/java/io/office/modules/manage/entity/PolicyEntity.java
+2
-2
PolicyService.java
.../java/io/office/modules/manage/service/PolicyService.java
+4
-0
PolicyServiceImpl.java
...office/modules/manage/service/impl/PolicyServiceImpl.java
+31
-2
No files found.
src/main/java/io/office/modules/manage/controller/PolicyController.java
View file @
4201b6ce
...
@@ -5,25 +5,20 @@ import java.util.Map;
...
@@ -5,25 +5,20 @@ import java.util.Map;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.R
;
import
io.office.common.utils.R
;
import
io.office.modules.manage.entity.NewsEntity
;
import
io.office.modules.manage.entity.PolicyEntity
;
import
io.office.modules.manage.entity.PolicyEntity
;
import
io.office.modules.manage.service.PolicyService
;
import
io.office.modules.manage.service.PolicyService
;
import
io.office.modules.sys.controller.AbstractController
;
import
io.office.modules.sys.controller.AbstractController
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
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
;
/**
/**
*
${comments}
*
政策法规
*
*
* @author
chenshun
* @author
rkl
* @email sunlightcs@gmail.com
* @email sunlightcs@gmail.com
* @date 2021-11-04 22:13:54
* @date 2021-11-04 22:13:54
*/
*/
...
@@ -93,9 +88,27 @@ public class PolicyController extends AbstractController {
...
@@ -93,9 +88,27 @@ public class PolicyController extends AbstractController {
@RequestMapping
(
"/delete"
)
@RequestMapping
(
"/delete"
)
// @RequiresPermissions("generator:policy:delete")
// @RequiresPermissions("generator:policy:delete")
public
R
delete
(
@RequestBody
Integer
[]
ids
){
public
R
delete
(
@RequestBody
Integer
[]
ids
){
policyService
.
removeByIds
(
Arrays
.
asList
(
ids
));
try
{
R
r
=
this
.
policyService
.
deletePolicy
(
ids
,
getUser
());
return
R
.
ok
();
return
r
;
}
catch
(
Exception
e
)
{
log
.
error
(
"delete error:"
,
e
);
return
R
.
error
(
e
.
getMessage
());
}
}
/**
* 审核
*/
@PostMapping
(
"/verifyPolicy"
)
// @RequiresPermissions("manage:news:verify")
public
R
verify
(
@RequestBody
PolicyEntity
policyEntity
)
{
try
{
R
r
=
this
.
policyService
.
verifyTopic
(
policyEntity
,
getUser
());
return
r
;
}
catch
(
Exception
e
)
{
log
.
error
(
"verifyPolicy error:"
,
e
);
return
R
.
error
(
e
.
getMessage
());
}
}
}
}
}
src/main/java/io/office/modules/manage/entity/PolicyEntity.java
View file @
4201b6ce
...
@@ -89,11 +89,11 @@ public class PolicyEntity implements Serializable {
...
@@ -89,11 +89,11 @@ public class PolicyEntity implements Serializable {
/**
/**
* $column.comments
* $column.comments
*/
*/
private
Date
publicdate
;
private
String
publicdate
;
/**
/**
* $column.comments
* $column.comments
*/
*/
private
Date
startdate
;
private
String
startdate
;
/**
/**
* $column.comments
* $column.comments
*/
*/
...
...
src/main/java/io/office/modules/manage/service/PolicyService.java
View file @
4201b6ce
...
@@ -22,5 +22,9 @@ public interface PolicyService extends IService<PolicyEntity> {
...
@@ -22,5 +22,9 @@ public interface PolicyService extends IService<PolicyEntity> {
R
inserPolicy
(
PolicyEntity
policy
,
SysUserEntity
user
);
R
inserPolicy
(
PolicyEntity
policy
,
SysUserEntity
user
);
R
updatePolicy
(
PolicyEntity
policy
,
SysUserEntity
user
);
R
updatePolicy
(
PolicyEntity
policy
,
SysUserEntity
user
);
R
deletePolicy
(
Integer
[]
ids
,
SysUserEntity
user
);
R
verifyTopic
(
PolicyEntity
policyEntity
,
SysUserEntity
user
);
}
}
src/main/java/io/office/modules/manage/service/impl/PolicyServiceImpl.java
View file @
4201b6ce
package
io
.
office
.
modules
.
manage
.
service
.
impl
;
package
io
.
office
.
modules
.
manage
.
service
.
impl
;
import
io.office.common.utils.DateUtils
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.Query
;
import
io.office.common.utils.Query
;
import
io.office.common.utils.R
;
import
io.office.common.utils.R
;
...
@@ -34,8 +35,8 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyDao, PolicyEntity> impl
...
@@ -34,8 +35,8 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyDao, PolicyEntity> impl
public
R
inserPolicy
(
PolicyEntity
policy
,
SysUserEntity
user
)
{
public
R
inserPolicy
(
PolicyEntity
policy
,
SysUserEntity
user
)
{
policy
.
setEditor
(
user
.
getUsername
());
policy
.
setEditor
(
user
.
getUsername
());
policy
.
setLasteditor
(
user
.
getUsername
());
policy
.
setLasteditor
(
user
.
getUsername
());
policy
.
set
Start
date
(
new
Date
());
policy
.
set
Release
date
(
new
Date
());
policy
.
set
Public
date
(
new
Date
());
policy
.
set
Update
date
(
new
Date
());
//二级栏目不为空时 classid取值二级栏目id值
//二级栏目不为空时 classid取值二级栏目id值
int
insert
=
baseMapper
.
insert
(
policy
);
int
insert
=
baseMapper
.
insert
(
policy
);
if
(
insert
>
0
){
if
(
insert
>
0
){
...
@@ -54,6 +55,7 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyDao, PolicyEntity> impl
...
@@ -54,6 +55,7 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyDao, PolicyEntity> impl
newsEntityQueryWrapper
.
eq
(
"id"
,
policy
.
getId
());
newsEntityQueryWrapper
.
eq
(
"id"
,
policy
.
getId
());
policy
.
setEditor
(
user
.
getUsername
());
policy
.
setEditor
(
user
.
getUsername
());
policy
.
setLasteditor
(
user
.
getUsername
());
policy
.
setLasteditor
(
user
.
getUsername
());
policy
.
setUpdatedate
(
new
Date
());
int
update
=
baseMapper
.
update
(
policy
,
newsEntityQueryWrapper
);
int
update
=
baseMapper
.
update
(
policy
,
newsEntityQueryWrapper
);
if
(
update
>
0
){
if
(
update
>
0
){
return
R
.
ok
(
"修改成功!"
);
return
R
.
ok
(
"修改成功!"
);
...
@@ -62,4 +64,30 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyDao, PolicyEntity> impl
...
@@ -62,4 +64,30 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyDao, PolicyEntity> impl
}
}
}
}
@Override
public
R
deletePolicy
(
Integer
[]
ids
,
SysUserEntity
user
)
{
PolicyEntity
policyEntity
=
new
PolicyEntity
();
policyEntity
.
setLevels
(
0
);
policyEntity
.
setLasteditor
(
user
.
getUsername
());
policyEntity
.
setUpdatedate
(
new
Date
());
QueryWrapper
<
PolicyEntity
>
newsEntityQueryWrapper
=
new
QueryWrapper
<>();
newsEntityQueryWrapper
.
in
(
"id"
,
ids
);
int
delete
=
baseMapper
.
update
(
policyEntity
,
newsEntityQueryWrapper
);
if
(
delete
>
0
){
return
R
.
ok
(
"删除成功!"
);
}
else
{
return
R
.
error
(
"删除失败!"
);
}
}
@Override
public
R
verifyTopic
(
PolicyEntity
policyEntity
,
SysUserEntity
user
)
{
policyEntity
.
setAuditor
(
user
.
getUsername
());
policyEntity
.
setLasteditor
(
user
.
getUsername
());
QueryWrapper
<
PolicyEntity
>
newsEntityQueryWrapper
=
new
QueryWrapper
<>();
newsEntityQueryWrapper
.
eq
(
"id"
,
policyEntity
.
getId
());
baseMapper
.
update
(
policyEntity
,
newsEntityQueryWrapper
);
return
R
.
ok
(
"审核成功!"
);
}
}
}
\ 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