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
093c66b2
Commit
093c66b2
authored
Dec 31, 2021
by
rongkailun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【新增】服务管理---文档管理功能新增
parent
ee4aa874
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
119 additions
and
12 deletions
+119
-12
DocController.java
...va/io/office/modules/manage/controller/DocController.java
+25
-10
DocDao.java
src/main/java/io/office/modules/manage/dao/DocDao.java
+7
-1
DocService.java
...ain/java/io/office/modules/manage/service/DocService.java
+10
-0
DocServiceImpl.java
...io/office/modules/manage/service/impl/DocServiceImpl.java
+35
-1
DocDao.xml
src/main/resources/mapper/manage/DocDao.xml
+42
-0
No files found.
src/main/java/io/office/modules/manage/controller/DocController.java
View file @
093c66b2
package
io
.
office
.
modules
.
manage
.
controller
;
package
io
.
office
.
modules
.
manage
.
controller
;
import
java.util.Arrays
;
import
java.util.Arrays
;
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
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.modules.app.annotation.Login
;
import
io.office.modules.app.annotation.Login
;
import
io.office.modules.manage.entity.DocEntity
;
import
io.office.modules.manage.entity.DocEntity
;
import
io.office.modules.manage.entity.NewsEntity
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.manage.vo.request.TopicNewsPartyRequestVo
;
import
io.office.modules.manage.vo.request.TopicNewsPartyRequestVo
;
import
io.office.modules.sys.controller.AbstractController
;
import
io.office.modules.sys.entity.SysUserEntity
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -26,7 +32,7 @@ import io.office.common.utils.R;
...
@@ -26,7 +32,7 @@ import io.office.common.utils.R;
@Slf4j
@Slf4j
@RestController
@RestController
@RequestMapping
(
"/doc"
)
@RequestMapping
(
"/doc"
)
public
class
DocController
{
public
class
DocController
extends
AbstractController
{
@Autowired
@Autowired
private
DocService
docService
;
private
DocService
docService
;
...
@@ -35,10 +41,11 @@ public class DocController {
...
@@ -35,10 +41,11 @@ public class DocController {
*/
*/
@RequestMapping
(
"/list"
)
@RequestMapping
(
"/list"
)
// @RequiresPermissions("manage:doc:list")
// @RequiresPermissions("manage:doc:list")
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
){
public
R
list
(
@RequestBody
NewsParams
newsParams
){
PageUtils
page
=
docService
.
queryPage
(
params
);
Page
<
DocEntity
>
page
=
this
.
docService
.
selectDocList
(
newsParams
,
new
Page
(
newsParams
.
getPage
(),
newsParams
.
getLimit
()));
return
R
.
ok
().
put
(
"page"
,
page
);
PageUtils
pageUtils
=
new
PageUtils
(
page
);
return
R
.
ok
().
put
(
"page"
,
pageUtils
);
}
}
...
@@ -59,8 +66,7 @@ public class DocController {
...
@@ -59,8 +66,7 @@ public class DocController {
@RequestMapping
(
"/save"
)
@RequestMapping
(
"/save"
)
// @RequiresPermissions("manage:doc:save")
// @RequiresPermissions("manage:doc:save")
public
R
save
(
@RequestBody
DocEntity
doc
){
public
R
save
(
@RequestBody
DocEntity
doc
){
docService
.
save
(
doc
);
docService
.
save
(
doc
);
return
R
.
ok
();
return
R
.
ok
();
}
}
...
@@ -71,7 +77,6 @@ public class DocController {
...
@@ -71,7 +77,6 @@ public class DocController {
// @RequiresPermissions("manage:doc:update")
// @RequiresPermissions("manage:doc:update")
public
R
update
(
@RequestBody
DocEntity
doc
){
public
R
update
(
@RequestBody
DocEntity
doc
){
docService
.
updateById
(
doc
);
docService
.
updateById
(
doc
);
return
R
.
ok
();
return
R
.
ok
();
}
}
...
@@ -80,12 +85,22 @@ public class DocController {
...
@@ -80,12 +85,22 @@ public class DocController {
*/
*/
@RequestMapping
(
"/delete"
)
@RequestMapping
(
"/delete"
)
// @RequiresPermissions("manage:doc:delete")
// @RequiresPermissions("manage:doc:delete")
public
R
delete
(
@RequestBody
Integer
[]
ids
){
public
R
delete
(
@RequestBody
List
<
Long
>
ids
){
docService
.
removeByIds
(
Arrays
.
asList
(
ids
));
this
.
docService
.
deleteDoc
(
ids
);
return
R
.
ok
();
}
/**
* 审核
*/
@RequestMapping
(
"/verify"
)
// @RequiresPermissions("manage:doc:verify")
public
R
verify
(
@RequestBody
DocEntity
doc
){
this
.
docService
.
verifyDoc
(
doc
,
getUser
());
return
R
.
ok
();
return
R
.
ok
();
}
}
@Login
@Login
@PostMapping
(
"/api/downLoad"
)
@PostMapping
(
"/api/downLoad"
)
// @RequiresPermissions("generator:indexcarouselmanage:pictureImageList")
// @RequiresPermissions("generator:indexcarouselmanage:pictureImageList")
...
...
src/main/java/io/office/modules/manage/dao/DocDao.java
View file @
093c66b2
package
io
.
office
.
modules
.
manage
.
dao
;
package
io
.
office
.
modules
.
manage
.
dao
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.modules.manage.entity.DocEntity
;
import
io.office.modules.manage.entity.DocEntity
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
/**
* ${comments}
* ${comments}
...
@@ -13,5 +18,6 @@ import org.apache.ibatis.annotations.Mapper;
...
@@ -13,5 +18,6 @@ import org.apache.ibatis.annotations.Mapper;
*/
*/
@Mapper
@Mapper
public
interface
DocDao
extends
BaseMapper
<
DocEntity
>
{
public
interface
DocDao
extends
BaseMapper
<
DocEntity
>
{
List
<
DocEntity
>
selectDocList
(
@Param
(
"newsParams"
)
NewsParams
newsParams
,
Page
page
);
}
}
src/main/java/io/office/modules/manage/service/DocService.java
View file @
093c66b2
package
io
.
office
.
modules
.
manage
.
service
;
package
io
.
office
.
modules
.
manage
.
service
;
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.modules.manage.entity.DocEntity
;
import
io.office.modules.manage.entity.DocEntity
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.sys.entity.SysUserEntity
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
...
@@ -16,5 +20,11 @@ import java.util.Map;
...
@@ -16,5 +20,11 @@ import java.util.Map;
public
interface
DocService
extends
IService
<
DocEntity
>
{
public
interface
DocService
extends
IService
<
DocEntity
>
{
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
);
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
);
Page
<
DocEntity
>
selectDocList
(
NewsParams
newsParams
,
Page
page
);
void
deleteDoc
(
List
<
Long
>
ids
);
void
verifyDoc
(
DocEntity
doc
,
SysUserEntity
user
);
}
}
src/main/java/io/office/modules/manage/service/impl/DocServiceImpl.java
View file @
093c66b2
package
io
.
office
.
modules
.
manage
.
service
.
impl
;
package
io
.
office
.
modules
.
manage
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.modules.manage.entity.PartnersEntity
;
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.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.Map
;
import
java.util.*
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
...
@@ -16,6 +22,9 @@ import io.office.modules.manage.service.DocService;
...
@@ -16,6 +22,9 @@ import io.office.modules.manage.service.DocService;
@Service
(
"docService"
)
@Service
(
"docService"
)
public
class
DocServiceImpl
extends
ServiceImpl
<
DocDao
,
DocEntity
>
implements
DocService
{
public
class
DocServiceImpl
extends
ServiceImpl
<
DocDao
,
DocEntity
>
implements
DocService
{
@Autowired
private
DocDao
docDao
;
@Override
@Override
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
IPage
<
DocEntity
>
page
=
this
.
page
(
IPage
<
DocEntity
>
page
=
this
.
page
(
...
@@ -26,4 +35,28 @@ public class DocServiceImpl extends ServiceImpl<DocDao, DocEntity> implements Do
...
@@ -26,4 +35,28 @@ public class DocServiceImpl extends ServiceImpl<DocDao, DocEntity> implements Do
return
new
PageUtils
(
page
);
return
new
PageUtils
(
page
);
}
}
@Override
public
Page
<
DocEntity
>
selectDocList
(
NewsParams
newsParams
,
Page
page
)
{
List
<
DocEntity
>
list
=
this
.
docDao
.
selectDocList
(
newsParams
,
page
);
page
.
setRecords
(
list
);
return
page
;
}
@Override
public
void
deleteDoc
(
List
<
Long
>
ids
)
{
QueryWrapper
<
DocEntity
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
in
(
"id"
,
ids
);
DocEntity
docEntity
=
new
DocEntity
();
docEntity
.
setLevels
(
0
);
this
.
baseMapper
.
update
(
docEntity
,
queryWrapper
);
}
@Override
public
void
verifyDoc
(
DocEntity
doc
,
SysUserEntity
user
)
{
QueryWrapper
<
DocEntity
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
in
(
"id"
,
doc
.
getId
());
doc
.
setAuditor
(
user
.
getUsername
());
this
.
baseMapper
.
update
(
doc
,
queryWrapper
);
}
}
}
\ No newline at end of file
src/main/resources/mapper/manage/DocDao.xml
0 → 100644
View file @
093c66b2
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"io.office.modules.manage.dao.DocDao"
>
<!-- 可根据自己的需求,是否要使用 -->
<resultMap
type=
"io.office.modules.manage.entity.DocEntity"
id=
"docMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"title"
column=
"title"
/>
<result
property=
"author"
column=
"author"
/>
<result
property=
"levels"
column=
"levels"
/>
<result
property=
"category"
column=
"category"
/>
<result
property=
"docfile"
column=
"docfile"
/>
<result
property=
"stand"
column=
"stand"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"auditor"
column=
"auditor"
/>
</resultMap>
<select
id=
"selectDocList"
resultMap=
"docMap"
>
SELECT
*, (
CASE
WHEN category = 1 THEN
'表格下载'
ELSE
'分支机构培训计划'
END
) categoryname
FROM
doc
where 1=1
<if
test=
"newsParams.type !=null and newsParams.type !=''"
>
and category =#{newsParams.type}
</if>
<if
test=
"newsParams.title !=null and newsParams.title !=''"
>
and title like concat('%',#{newsParams.title},'%')
</if>
ORDER BY
id DESC
</select>
</mapper>
\ 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