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
b6909303
Commit
b6909303
authored
Dec 08, 2021
by
rongkailun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【新增】专业术语、小贴士
parent
1f1019fa
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
318 additions
and
0 deletions
+318
-0
KnowledgeinfoController.java
...ce/modules/manage/controller/KnowledgeinfoController.java
+90
-0
NewsController.java
...a/io/office/modules/manage/controller/NewsController.java
+15
-0
KnowledgeinfoDao.java
...n/java/io/office/modules/manage/dao/KnowledgeinfoDao.java
+17
-0
NewsDao.java
src/main/java/io/office/modules/manage/dao/NewsDao.java
+5
-0
KnowledgeinfoEntity.java
.../io/office/modules/manage/entity/KnowledgeinfoEntity.java
+68
-0
NewsParams.java
.../java/io/office/modules/manage/entity/dto/NewsParams.java
+2
-0
KnowledgeinfoService.java
...o/office/modules/manage/service/KnowledgeinfoService.java
+20
-0
NewsService.java
...in/java/io/office/modules/manage/service/NewsService.java
+4
-0
KnowledgeinfoServiceImpl.java
...modules/manage/service/impl/KnowledgeinfoServiceImpl.java
+30
-0
NewsServiceImpl.java
...o/office/modules/manage/service/impl/NewsServiceImpl.java
+13
-0
KnowledgeinfoDao.xml
src/main/resources/mapper/manage/KnowledgeinfoDao.xml
+23
-0
NewsDao.xml
src/main/resources/mapper/manage/NewsDao.xml
+31
-0
No files found.
src/main/java/io/office/modules/manage/controller/KnowledgeinfoController.java
0 → 100644
View file @
b6909303
package
io
.
office
.
modules
.
manage
.
controller
;
import
java.util.Arrays
;
import
java.util.Map
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PathVariable
;
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.KnowledgeinfoEntity
;
import
io.office.modules.manage.service.KnowledgeinfoService
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.R
;
/**
* 小贴士
*
* @author wudi
* @email
* @date 2021-12-08 08:59:11
*/
@RestController
@RequestMapping
(
"/knowledgeinfo"
)
public
class
KnowledgeinfoController
{
@Autowired
private
KnowledgeinfoService
knowledgeinfoService
;
/**
* 列表
*/
@RequestMapping
(
"/list"
)
// @RequiresPermissions("manage:knowledgeinfo:list")
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
){
PageUtils
page
=
knowledgeinfoService
.
queryPage
(
params
);
return
R
.
ok
().
put
(
"page"
,
page
);
}
/**
* 信息
*/
@RequestMapping
(
"/info/{knowledgeinfoid}"
)
// @RequiresPermissions("manage:knowledgeinfo:info")
public
R
info
(
@PathVariable
(
"knowledgeinfoid"
)
Integer
knowledgeinfoid
){
KnowledgeinfoEntity
knowledgeinfo
=
knowledgeinfoService
.
getById
(
knowledgeinfoid
);
return
R
.
ok
().
put
(
"knowledgeinfo"
,
knowledgeinfo
);
}
/**
* 保存
*/
@RequestMapping
(
"/save"
)
// @RequiresPermissions("manage:knowledgeinfo:save")
public
R
save
(
@RequestBody
KnowledgeinfoEntity
knowledgeinfo
){
knowledgeinfoService
.
save
(
knowledgeinfo
);
return
R
.
ok
();
}
/**
* 修改
*/
@RequestMapping
(
"/update"
)
// @RequiresPermissions("manage:knowledgeinfo:update")
public
R
update
(
@RequestBody
KnowledgeinfoEntity
knowledgeinfo
){
knowledgeinfoService
.
updateById
(
knowledgeinfo
);
return
R
.
ok
();
}
/**
* 删除
*/
@RequestMapping
(
"/delete"
)
// @RequiresPermissions("manage:knowledgeinfo:delete")
public
R
delete
(
@RequestBody
Integer
[]
knowledgeinfoids
){
knowledgeinfoService
.
removeByIds
(
Arrays
.
asList
(
knowledgeinfoids
));
return
R
.
ok
();
}
}
src/main/java/io/office/modules/manage/controller/NewsController.java
View file @
b6909303
...
...
@@ -339,5 +339,20 @@ public class NewsController extends AbstractController {
PageUtils
pageUtils
=
new
PageUtils
(
page
);
return
R
.
ok
().
put
(
"data"
,
pageUtils
);
}
/**专业术语*/
@Login
@PostMapping
(
"/api/glossaryList"
)
public
R
glossaryList
(
@RequestBody
NewsParams
newsParams
)
{
List
<
GlossaryEntity
>
list
=
this
.
newsService
.
glossaryList
(
newsParams
);
return
R
.
ok
().
put
(
"data"
,
list
);
}
/**小贴士*/
@Login
@PostMapping
(
"/api/tips"
)
public
R
tips
(
NewsParams
newsParams
)
{
List
<
KnowledgeinfoEntity
>
list
=
this
.
newsService
.
selectTips
(
newsParams
);
return
R
.
ok
().
put
(
"data"
,
list
);
}
}
src/main/java/io/office/modules/manage/dao/KnowledgeinfoDao.java
0 → 100644
View file @
b6909303
package
io
.
office
.
modules
.
manage
.
dao
;
import
io.office.modules.manage.entity.KnowledgeinfoEntity
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-08 08:59:11
*/
@Mapper
public
interface
KnowledgeinfoDao
extends
BaseMapper
<
KnowledgeinfoEntity
>
{
}
src/main/java/io/office/modules/manage/dao/NewsDao.java
View file @
b6909303
...
...
@@ -59,4 +59,9 @@ public interface NewsDao extends BaseMapper<NewsEntity> {
List
<
PolicyEntity
>
ycxgbzList
();
List
<
PolicyEntity
>
zcfgList
(
NewsParams
newsParams
,
Page
page
);
List
<
GlossaryEntity
>
glossaryList
(
@Param
(
"newsParams"
)
NewsParams
newsParams
);
List
<
KnowledgeinfoEntity
>
selectTips
(
NewsParams
newsParams
);
}
src/main/java/io/office/modules/manage/entity/KnowledgeinfoEntity.java
0 → 100644
View file @
b6909303
package
io
.
office
.
modules
.
manage
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
java.io.Serializable
;
import
java.util.Date
;
import
lombok.Data
;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-08 08:59:11
*/
@Data
@TableName
(
"knowledgeInfo"
)
public
class
KnowledgeinfoEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* $column.comments
*/
@TableId
private
Integer
knowledgeinfoid
;
/**
* $column.comments
*/
private
Integer
knowledgecategoryid
;
/**
* $column.comments
*/
private
Integer
levels
;
/**
* $column.comments
*/
private
String
title
;
/**
* $column.comments
*/
private
String
editor
;
/**
* $column.comments
*/
private
Date
inputdate
;
/**
* $column.comments
*/
private
String
content
;
/**
* $column.comments
*/
private
String
directpath
;
/**
* $column.comments
*/
private
Integer
hits
;
/**
* 0等待审核、1成功、2失败
*/
private
Integer
status
;
/**
* $column.comments
*/
private
String
auditor
;
}
src/main/java/io/office/modules/manage/entity/dto/NewsParams.java
View file @
b6909303
...
...
@@ -30,4 +30,6 @@ public class NewsParams extends PageParams {
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
updateTimeEnd
;
private
Integer
classId
;
private
String
type
;
}
src/main/java/io/office/modules/manage/service/KnowledgeinfoService.java
0 → 100644
View file @
b6909303
package
io
.
office
.
modules
.
manage
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
io.office.common.utils.PageUtils
;
import
io.office.modules.manage.entity.KnowledgeinfoEntity
;
import
java.util.Map
;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-08 08:59:11
*/
public
interface
KnowledgeinfoService
extends
IService
<
KnowledgeinfoEntity
>
{
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
);
}
src/main/java/io/office/modules/manage/service/NewsService.java
View file @
b6909303
...
...
@@ -60,5 +60,9 @@ public interface NewsService extends IService<NewsEntity> {
List
<
PolicyEntity
>
ycxgbzList
();
Page
<
PolicyEntity
>
zcfgList
(
NewsParams
newsParams
,
Page
page
);
List
<
GlossaryEntity
>
glossaryList
(
NewsParams
newsParams
);
List
<
KnowledgeinfoEntity
>
selectTips
(
NewsParams
newsParams
);
}
src/main/java/io/office/modules/manage/service/impl/KnowledgeinfoServiceImpl.java
0 → 100644
View file @
b6909303
package
io
.
office
.
modules
.
manage
.
service
.
impl
;
import
org.springframework.stereotype.Service
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.Query
;
import
io.office.modules.manage.dao.KnowledgeinfoDao
;
import
io.office.modules.manage.entity.KnowledgeinfoEntity
;
import
io.office.modules.manage.service.KnowledgeinfoService
;
@Service
(
"knowledgeinfoService"
)
public
class
KnowledgeinfoServiceImpl
extends
ServiceImpl
<
KnowledgeinfoDao
,
KnowledgeinfoEntity
>
implements
KnowledgeinfoService
{
@Override
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
IPage
<
KnowledgeinfoEntity
>
page
=
this
.
page
(
new
Query
<
KnowledgeinfoEntity
>().
getPage
(
params
),
new
QueryWrapper
<
KnowledgeinfoEntity
>()
);
return
new
PageUtils
(
page
);
}
}
\ No newline at end of file
src/main/java/io/office/modules/manage/service/impl/NewsServiceImpl.java
View file @
b6909303
...
...
@@ -213,5 +213,17 @@ public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements
return
page
;
}
@Override
public
List
<
GlossaryEntity
>
glossaryList
(
NewsParams
newsParams
)
{
List
<
GlossaryEntity
>
list
=
this
.
newsDao
.
glossaryList
(
newsParams
);
return
list
;
}
@Override
public
List
<
KnowledgeinfoEntity
>
selectTips
(
NewsParams
newsParams
)
{
List
<
KnowledgeinfoEntity
>
list
=
this
.
newsDao
.
selectTips
(
newsParams
);
return
list
;
}
}
\ No newline at end of file
src/main/resources/mapper/manage/KnowledgeinfoDao.xml
0 → 100644
View file @
b6909303
<?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.KnowledgeinfoDao"
>
<!-- 可根据自己的需求,是否要使用 -->
<resultMap
type=
"io.office.modules.manage.entity.KnowledgeinfoEntity"
id=
"knowledgeinfoMap"
>
<result
property=
"knowledgeinfoid"
column=
"knowledgeInfoID"
/>
<result
property=
"knowledgecategoryid"
column=
"knowledgeCategoryID"
/>
<result
property=
"levels"
column=
"Levels"
/>
<result
property=
"title"
column=
"Title"
/>
<result
property=
"editor"
column=
"Editor"
/>
<result
property=
"inputdate"
column=
"inputDate"
/>
<result
property=
"content"
column=
"Content"
/>
<result
property=
"directpath"
column=
"directpath"
/>
<result
property=
"hits"
column=
"hits"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"auditor"
column=
"auditor"
/>
</resultMap>
</mapper>
\ No newline at end of file
src/main/resources/mapper/manage/NewsDao.xml
View file @
b6909303
...
...
@@ -394,4 +394,34 @@
<select
id=
"zcfgList"
resultType=
"io.office.modules.manage.entity.PolicyEntity"
>
select * from Policy where class='法律法规' and levels>0 and status > 0 order by levels desc,releasedate desc
</select>
<select
id=
"glossaryList"
resultType=
"io.office.modules.manage.entity.GlossaryEntity"
parameterType=
"io.office.modules.manage.entity.dto.NewsParams"
>
select * from Glossary t where 1=1
<if
test=
"newsParams.type == 1"
>
and t.title_CN like concat(concat('%',#{newsParams.title}),'%')
</if>
<if
test=
"newsParams.type == 2"
>
and t.title_EN like concat(concat('%',#{newsParams.title}),'%')
</if>
<if
test=
"newsParams.type == 3"
>
and t.content like concat(concat('%',#{newsParams.title}),'%')
</if>
</select>
<select
id=
"selectTips"
resultType=
"io.office.modules.manage.entity.KnowledgeinfoEntity"
>
SELECT
*
FROM
knowledgeInfo
WHERE
(
knowledgecategoryid = 126
OR knowledgecategoryid = 127
)
AND status = 1
AND levels > 0
ORDER BY
levels DESC,
knowledgeInfoid 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