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
9ced1266
Commit
9ced1266
authored
Nov 15, 2021
by
rongkailun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【新增】商品管理审核、列表;术语管理新增列表修改
parent
f80999e3
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
373 additions
and
8 deletions
+373
-8
GlossaryController.java
.../office/modules/manage/controller/GlossaryController.java
+100
-0
ProductController.java
...o/office/modules/manage/controller/ProductController.java
+24
-7
GlossaryDao.java
src/main/java/io/office/modules/manage/dao/GlossaryDao.java
+23
-0
ProductDao.java
src/main/java/io/office/modules/manage/dao/ProductDao.java
+6
-0
GlossaryEntity.java
.../java/io/office/modules/manage/entity/GlossaryEntity.java
+72
-0
GlossaryService.java
...ava/io/office/modules/manage/service/GlossaryService.java
+24
-0
ProductService.java
...java/io/office/modules/manage/service/ProductService.java
+6
-0
GlossaryServiceImpl.java
...fice/modules/manage/service/impl/GlossaryServiceImpl.java
+43
-0
ProductServiceImpl.java
...ffice/modules/manage/service/impl/ProductServiceImpl.java
+26
-0
GlossaryDao.xml
src/main/resources/mapper/manage/GlossaryDao.xml
+38
-0
ProductDao.xml
src/main/resources/mapper/manage/ProductDao.xml
+11
-1
No files found.
src/main/java/io/office/modules/manage/controller/GlossaryController.java
0 → 100644
View file @
9ced1266
package
io
.
office
.
modules
.
manage
.
controller
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.modules.manage.entity.ProductEntity
;
import
io.office.modules.sys.controller.AbstractController
;
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.GlossaryEntity
;
import
io.office.modules.manage.service.GlossaryService
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.R
;
/**
*
* 术语管理
* @author rkl
* @email
* @date 2021-11-15 18:29:59
*/
@RestController
@RequestMapping
(
"/glossary"
)
public
class
GlossaryController
extends
AbstractController
{
@Autowired
private
GlossaryService
glossaryService
;
/**
* 列表
*/
@RequestMapping
(
"/list"
)
// @RequiresPermissions("manage:glossary:list")
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
){
Page
<
GlossaryEntity
>
page
=
this
.
glossaryService
.
selectGlossaryList
(
params
,
new
Page
(
Integer
.
valueOf
(
params
.
get
(
"page"
).
toString
()),
Integer
.
valueOf
(
params
.
get
(
"limit"
).
toString
())));
return
R
.
ok
().
put
(
"page"
,
page
);
}
/**
* 信息
*/
@RequestMapping
(
"/info/{id}"
)
// @RequiresPermissions("manage:glossary:info")
public
R
info
(
@PathVariable
(
"id"
)
Integer
id
){
GlossaryEntity
glossary
=
glossaryService
.
getById
(
id
);
return
R
.
ok
().
put
(
"glossary"
,
glossary
);
}
/**
* 保存
*/
@RequestMapping
(
"/save"
)
// @RequiresPermissions("manage:glossary:save")
public
R
save
(
@RequestBody
GlossaryEntity
glossary
){
glossary
.
setEditor
(
getUser
().
getUsername
());
glossary
.
setLasteditor
(
getUser
().
getUsername
());
glossaryService
.
save
(
glossary
);
return
R
.
ok
(
"术语新增成功!"
);
}
/**
* 修改
*/
@RequestMapping
(
"/update"
)
// @RequiresPermissions("manage:glossary:update")
public
R
update
(
@RequestBody
GlossaryEntity
glossary
){
glossary
.
setEditor
(
getUser
().
getUsername
());
glossary
.
setLasteditor
(
getUser
().
getUsername
());
glossary
.
setUpdatedate
(
new
Date
());
glossaryService
.
updateById
(
glossary
);
return
R
.
ok
(
"术语修改成功!"
);
}
/**
* 删除
*/
@RequestMapping
(
"/delete"
)
// @RequiresPermissions("manage:glossary:delete")
public
R
delete
(
@RequestBody
Integer
[]
ids
){
GlossaryEntity
glossary
=
new
GlossaryEntity
();
glossary
.
setEditor
(
getUser
().
getUsername
());
glossary
.
setLasteditor
(
getUser
().
getUsername
());
glossaryService
.
updateById
(
glossary
);
return
R
.
ok
(
"术语删除成功!"
);
}
}
src/main/java/io/office/modules/manage/controller/ProductController.java
View file @
9ced1266
...
...
@@ -4,15 +4,14 @@ import java.util.Arrays;
import
java.util.List
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.modules.manage.entity.NewsEntity
;
import
io.office.modules.sys.controller.AbstractController
;
import
io.swagger.models.auth.In
;
import
lombok.extern.slf4j.Slf4j
;
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
org.springframework.web.bind.annotation.*
;
import
io.office.modules.manage.entity.ProductEntity
;
import
io.office.modules.manage.service.ProductService
;
...
...
@@ -41,8 +40,11 @@ public class ProductController extends AbstractController {
@RequestMapping
(
"/list"
)
// @RequiresPermissions("manage:product:list")
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
){
PageUtils
page
=
productService
.
queryPage
(
params
);
return
R
.
ok
().
put
(
"page"
,
page
);
Page
<
ProductEntity
>
page
=
this
.
productService
.
selectProductList
(
params
,
new
Page
(
Integer
.
valueOf
(
params
.
get
(
"page"
).
toString
()),
Integer
.
valueOf
(
params
.
get
(
"limit"
).
toString
())));
PageUtils
pageUtils
=
new
PageUtils
(
page
);
return
R
.
ok
().
put
(
"page"
,
pageUtils
);
}
...
...
@@ -97,4 +99,19 @@ public class ProductController extends AbstractController {
}
}
/**
* 审核
*/
@PostMapping
(
"/verifyProduct"
)
// @RequiresPermissions("manage:news:verify")
public
R
verify
(
@RequestBody
ProductEntity
product
)
{
try
{
R
r
=
this
.
productService
.
verifyProduct
(
product
,
getUser
());
return
r
;
}
catch
(
Exception
e
)
{
log
.
error
(
"verifyProduct error:"
,
e
);
return
R
.
error
(
e
.
getMessage
());
}
}
}
src/main/java/io/office/modules/manage/dao/GlossaryDao.java
0 → 100644
View file @
9ced1266
package
io
.
office
.
modules
.
manage
.
dao
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.modules.manage.entity.GlossaryEntity
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-11-15 18:29:59
*/
@Mapper
public
interface
GlossaryDao
extends
BaseMapper
<
GlossaryEntity
>
{
List
<
GlossaryEntity
>
selectGlossaryList
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
,
Page
page
);
}
src/main/java/io/office/modules/manage/dao/ProductDao.java
View file @
9ced1266
package
io
.
office
.
modules
.
manage
.
dao
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.modules.manage.entity.ProductEntity
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
* ${comments}
...
...
@@ -14,4 +19,5 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public
interface
ProductDao
extends
BaseMapper
<
ProductEntity
>
{
List
<
ProductEntity
>
selectProductList
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
,
Page
page
);
}
src/main/java/io/office/modules/manage/entity/GlossaryEntity.java
0 → 100644
View file @
9ced1266
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 rkl
* @email
* @date 2021-11-15 18:29:59
*/
@Data
@TableName
(
"glossary"
)
public
class
GlossaryEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* $column.comments
*/
@TableId
private
Integer
id
;
/**
* $column.comments
*/
private
String
titleEn
;
/**
* $column.comments
*/
private
String
titleCn
;
/**
* $column.comments
*/
private
String
keyword
;
/**
* $column.comments
*/
private
String
brief
;
/**
* $column.comments
*/
private
Date
releasedate
;
/**
* $column.comments
*/
private
Date
updatedate
;
/**
* $column.comments
*/
private
String
author
;
/**
* $column.comments
*/
private
String
content
;
/**
* $column.comments
*/
private
Integer
hits
;
/**
* $column.comments
*/
private
String
editor
;
/**
* $column.comments
*/
private
String
lasteditor
;
}
src/main/java/io/office/modules/manage/service/GlossaryService.java
0 → 100644
View file @
9ced1266
package
io
.
office
.
modules
.
manage
.
service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
io.office.common.utils.PageUtils
;
import
io.office.modules.manage.entity.GlossaryEntity
;
import
io.office.modules.manage.entity.ProductEntity
;
import
java.util.Map
;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-11-15 18:29:59
*/
public
interface
GlossaryService
extends
IService
<
GlossaryEntity
>
{
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
);
Page
<
GlossaryEntity
>
selectGlossaryList
(
Map
<
String
,
Object
>
params
,
Page
page
);
}
src/main/java/io/office/modules/manage/service/ProductService.java
View file @
9ced1266
package
io
.
office
.
modules
.
manage
.
service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.R
;
import
io.office.modules.manage.entity.NewsEntity
;
import
io.office.modules.manage.entity.ProductEntity
;
import
io.office.modules.sys.entity.SysUserEntity
;
...
...
@@ -23,5 +25,9 @@ public interface ProductService extends IService<ProductEntity> {
R
insertProduct
(
ProductEntity
product
,
SysUserEntity
user
);
R
deleteProduct
(
List
<
Long
>
ids
,
SysUserEntity
user
);
R
verifyProduct
(
ProductEntity
product
,
SysUserEntity
user
);
Page
<
ProductEntity
>
selectProductList
(
Map
<
String
,
Object
>
params
,
Page
page
);
}
src/main/java/io/office/modules/manage/service/impl/GlossaryServiceImpl.java
0 → 100644
View file @
9ced1266
package
io
.
office
.
modules
.
manage
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.modules.manage.entity.ProductEntity
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
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.GlossaryDao
;
import
io.office.modules.manage.entity.GlossaryEntity
;
import
io.office.modules.manage.service.GlossaryService
;
@Service
(
"glossaryService"
)
public
class
GlossaryServiceImpl
extends
ServiceImpl
<
GlossaryDao
,
GlossaryEntity
>
implements
GlossaryService
{
@Autowired
GlossaryDao
glossaryDao
;
@Override
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
IPage
<
GlossaryEntity
>
page
=
this
.
page
(
new
Query
<
GlossaryEntity
>().
getPage
(
params
),
new
QueryWrapper
<
GlossaryEntity
>()
);
return
new
PageUtils
(
page
);
}
@Override
public
Page
<
GlossaryEntity
>
selectGlossaryList
(
Map
<
String
,
Object
>
params
,
Page
page
)
{
List
<
GlossaryEntity
>
list
=
this
.
glossaryDao
.
selectGlossaryList
(
params
,
page
);
page
.
setRecords
(
list
);
return
page
;
}
}
\ No newline at end of file
src/main/java/io/office/modules/manage/service/impl/ProductServiceImpl.java
View file @
9ced1266
package
io
.
office
.
modules
.
manage
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.common.utils.R
;
import
io.office.modules.manage.controller.ProductController
;
import
io.office.modules.manage.entity.NewsEntity
;
import
io.office.modules.sys.entity.SysUserEntity
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
...
...
@@ -22,6 +25,8 @@ import io.office.modules.manage.service.ProductService;
@Service
(
"productService"
)
public
class
ProductServiceImpl
extends
ServiceImpl
<
ProductDao
,
ProductEntity
>
implements
ProductService
{
@Autowired
ProductDao
productDao
;
@Override
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
IPage
<
ProductEntity
>
page
=
this
.
page
(
...
...
@@ -57,4 +62,24 @@ public class ProductServiceImpl extends ServiceImpl<ProductDao, ProductEntity> i
}
}
@Override
public
R
verifyProduct
(
ProductEntity
product
,
SysUserEntity
user
)
{
product
.
setAuditor
(
user
.
getUsername
());
QueryWrapper
<
ProductEntity
>
newsEntityQueryWrapper
=
new
QueryWrapper
<>();
newsEntityQueryWrapper
.
in
(
"id"
,
product
.
getId
());
int
delete
=
baseMapper
.
update
(
product
,
newsEntityQueryWrapper
);
if
(
delete
>
0
){
return
R
.
ok
(
"审核成功!"
);
}
else
{
return
R
.
error
(
"审核失败!"
);
}
}
@Override
public
Page
<
ProductEntity
>
selectProductList
(
Map
<
String
,
Object
>
params
,
Page
page
)
{
List
<
ProductEntity
>
list
=
this
.
productDao
.
selectProductList
(
params
,
page
);
page
.
setRecords
(
list
);
return
page
;
}
}
\ No newline at end of file
src/main/resources/mapper/manage/GlossaryDao.xml
0 → 100644
View file @
9ced1266
<?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.GlossaryDao"
>
<!-- 可根据自己的需求,是否要使用 -->
<resultMap
type=
"io.office.modules.manage.entity.GlossaryEntity"
id=
"glossaryMap"
>
<result
property=
"id"
column=
"ID"
/>
<result
property=
"titleEn"
column=
"title_EN"
/>
<result
property=
"titleCn"
column=
"title_CN"
/>
<result
property=
"keyword"
column=
"keyword"
/>
<result
property=
"brief"
column=
"brief"
/>
<result
property=
"releasedate"
column=
"releasedate"
/>
<result
property=
"updatedate"
column=
"updatedate"
/>
<result
property=
"author"
column=
"author"
/>
<result
property=
"content"
column=
"content"
/>
<result
property=
"hits"
column=
"hits"
/>
<result
property=
"editor"
column=
"editor"
/>
<result
property=
"lasteditor"
column=
"lasteditor"
/>
</resultMap>
<select
id=
"selectGlossaryList"
resultMap=
"glossaryMap"
parameterType=
"java.util.Map"
>
select * from glossary t
where 1=1
<if
test=
"params.titleCn !='' and params.titleCn !=null"
>
<choose>
<when
test=
"params.titleCn == '中文标题'"
>
and t.title_CN like concat('%',#{params.keyword},'%')
</when>
<otherwise>
and t.title_EN like concat('%',#{params.keyword},'%')
</otherwise>
</choose>
</if>
order by id desc
</select>
</mapper>
\ No newline at end of file
src/main/resources/mapper/manage/ProductDao.xml
View file @
9ced1266
...
...
@@ -47,5 +47,14 @@
<result
property=
"auditor"
column=
"auditor"
/>
</resultMap>
<select
id=
"selectProductList"
resultMap=
"productMap"
parameterType=
"java.util.Map"
>
select a.* from product a left join Pcategory b on a.categoryid=b.categoryid where levels>0
<if
test=
"params.keyword !='' and params.keyword !=null"
>
and a.prename like concat('%',#{params.keyword},'%')
</if>
<if
test=
"params.categoryid !='' and params.categoryid !=null"
>
and a.categoryid =#{params.categoryid}
</if>
order by a.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