Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
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
徐少华
midjourney-proxy
Commits
825dfd2f
Commit
825dfd2f
authored
Mar 09, 2020
by
zhuyajie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
书刊标签
parent
4e21f323
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
510 additions
and
10 deletions
+510
-10
BookBiz.java
...-book/src/main/java/com/pcloud/book/book/biz/BookBiz.java
+1
-1
BookLabelBiz.java
.../src/main/java/com/pcloud/book/book/biz/BookLabelBiz.java
+55
-0
BookBizImpl.java
.../main/java/com/pcloud/book/book/biz/impl/BookBizImpl.java
+2
-2
BookLabelBizImpl.java
.../java/com/pcloud/book/book/biz/impl/BookLabelBizImpl.java
+115
-0
BookLabelDao.java
.../src/main/java/com/pcloud/book/book/dao/BookLabelDao.java
+3
-1
BookLabelDaoImpl.java
.../java/com/pcloud/book/book/dao/impl/BookLabelDaoImpl.java
+9
-2
BookLabel.java
.../src/main/java/com/pcloud/book/book/entity/BookLabel.java
+25
-0
BookLabelAuditState.java
.../java/com/pcloud/book/book/enums/BookLabelAuditState.java
+34
-0
BookFacadeImpl.java
...java/com/pcloud/book/book/facade/impl/BookFacadeImpl.java
+2
-2
BookLabelFacadeImpl.java
...com/pcloud/book/book/facade/impl/BookLabelFacadeImpl.java
+133
-0
BookLabelVO.java
...ok/src/main/java/com/pcloud/book/book/vo/BookLabelVO.java
+42
-0
BookLabel.Mapper.xml
...-book/src/main/resources/mapper/book/BookLabel.Mapper.xml
+89
-2
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/BookBiz.java
View file @
825dfd2f
...
...
@@ -592,7 +592,7 @@ public interface BookBiz {
/**
* 获取书籍标签
*/
Map
<
Integer
,
List
<
BookLabel
>>
getBookLabels
();
Map
<
Integer
,
List
<
BookLabel
>>
getBookLabels
(
Long
partyId
);
/**
...
...
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/BookLabelBiz.java
0 → 100644
View file @
825dfd2f
package
com
.
pcloud
.
book
.
book
.
biz
;
import
com.pcloud.book.book.entity.BookLabel
;
import
com.pcloud.book.book.vo.BookLabelVO
;
import
com.pcloud.common.page.PageBeanNew
;
public
interface
BookLabelBiz
{
/**
* 申请新增标签
* @param bookLabel
* @param systemCode
*/
void
applyBookLabel
(
BookLabel
bookLabel
,
String
systemCode
);
/**
* 书刊标签审核
*/
void
auditBookLabel
(
BookLabelVO
bookLabelVO
);
/**
* 标签删除
* @param labelId
*/
void
deleteById
(
Long
labelId
);
/**
* 修改排序值
* @param labelId
* @param seq
*/
void
updateLabelSeq
(
Long
labelId
,
Integer
seq
);
/**
* 审核通过的标签列表
* @param labelType
* @param currentPage
* @param numPerPage
* @return
*/
PageBeanNew
<
BookLabelVO
>
listAuditPassBookLabel
(
Integer
labelType
,
Integer
currentPage
,
Integer
numPerPage
);
/**
* 标签管理列表
* @param labelType
* @param currentPage
* @param numPerPage
* @param name
* @param startTime
* @param endTime
* @return
*/
PageBeanNew
<
BookLabelVO
>
listApplyBookLabel
(
Integer
labelType
,
Integer
currentPage
,
Integer
numPerPage
,
String
name
,
String
startTime
,
String
endTime
,
Integer
auditState
);
}
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookBizImpl.java
View file @
825dfd2f
...
...
@@ -1817,9 +1817,9 @@ public class BookBizImpl implements BookBiz {
@ParamLog
(
"获取书籍标签"
)
@Override
public
Map
<
Integer
,
List
<
BookLabel
>>
getBookLabels
()
{
public
Map
<
Integer
,
List
<
BookLabel
>>
getBookLabels
(
Long
partyId
)
{
Map
<
Integer
,
List
<
BookLabel
>>
map
=
new
HashMap
<>();
List
<
BookLabel
>
bookLabels
=
bookLabelDao
.
getAll
();
List
<
BookLabel
>
bookLabels
=
bookLabelDao
.
getAll
(
partyId
);
if
(!
ListUtils
.
isEmpty
(
bookLabels
))
{
map
=
bookLabels
.
stream
().
collect
(
Collectors
.
groupingBy
(
BookLabel:
:
getType
));
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookLabelBizImpl.java
0 → 100644
View file @
825dfd2f
package
com
.
pcloud
.
book
.
book
.
biz
.
impl
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.book.biz.BookLabelBiz
;
import
com.pcloud.book.book.dao.BookLabelDao
;
import
com.pcloud.book.book.entity.BookLabel
;
import
com.pcloud.book.book.enums.BookLabelAuditState
;
import
com.pcloud.book.book.vo.BookLabelVO
;
import
com.pcloud.common.core.constant.SystemCode
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.utils.string.StringUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@Component
(
"bookLabelBiz"
)
public
class
BookLabelBizImpl
implements
BookLabelBiz
{
@Autowired
private
BookLabelDao
bookLabelDao
;
@Override
public
void
applyBookLabel
(
BookLabel
bookLabel
,
String
systemCode
)
{
List
<
BookLabel
>
labels
=
bookLabelDao
.
getListByType
(
bookLabel
.
getType
());
List
<
String
>
names
=
labels
.
stream
().
filter
(
s
->
s
.
getName
()!=
null
).
map
(
BookLabel:
:
getName
).
collect
(
Collectors
.
toList
());
if
(
names
.
contains
(
bookLabel
.
getName
())){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"标签名称重复或已申请"
);
}
Integer
seq
=
bookLabelDao
.
getMaxSeqByType
(
bookLabel
.
getType
());
if
(
SystemCode
.
pcloud
.
code
.
equalsIgnoreCase
(
systemCode
)){
//平台端直接新增
bookLabel
.
setAuditState
(
BookLabelAuditState
.
pass
.
code
);
bookLabel
.
setSeq
(
seq
+
1
);
bookLabelDao
.
insert
(
bookLabel
);
return
;
}
if
(
SystemCode
.
adviser
.
code
.
equalsIgnoreCase
(
systemCode
)){
//编辑端要审核
if
(
StringUtil
.
isEmpty
(
bookLabel
.
getRemark
())){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"缺少标签申请说明"
);
}
bookLabel
.
setAuditState
(
BookLabelAuditState
.
wait
.
code
);
bookLabel
.
setSeq
(
seq
+
1
);
bookLabelDao
.
insert
(
bookLabel
);
return
;
}
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
auditBookLabel
(
BookLabelVO
bookLabelVO
)
{
BookLabel
updateLabel
=
new
BookLabel
();
updateLabel
.
setId
(
bookLabelVO
.
getLabelId
());
updateLabel
.
setAuditState
(
bookLabelVO
.
getAuditState
());
if
(
BookLabelAuditState
.
update_pass
.
code
.
equals
(
bookLabelVO
.
getAuditState
())){
//修改后入库
List
<
BookLabel
>
labels
=
bookLabelDao
.
getListByType
(
bookLabelVO
.
getType
());
List
<
String
>
names
=
labels
.
stream
().
filter
(
s
->
s
.
getName
()!=
null
).
map
(
BookLabel:
:
getName
).
collect
(
Collectors
.
toList
());
if
(
names
.
contains
(
bookLabelVO
.
getName
())){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"标签名称重复或已申请"
);
}
BookLabel
bookLabel
=
new
BookLabel
();
bookLabel
.
setType
(
bookLabelVO
.
getType
());
bookLabel
.
setName
(
bookLabelVO
.
getName
());
bookLabel
.
setCreateUser
(
0L
);
bookLabel
.
setAuditState
(
BookLabelAuditState
.
pass
.
code
);
Integer
seq
=
bookLabelDao
.
getMaxSeqByType
(
bookLabel
.
getType
());
bookLabel
.
setSeq
(
seq
+
1
);
bookLabelDao
.
insert
(
bookLabel
);
Long
labelId
=
bookLabel
.
getId
();
updateLabel
.
setUpdateLabelId
(
labelId
);
}
bookLabelDao
.
update
(
updateLabel
);
}
@Override
public
void
deleteById
(
Long
labelId
)
{
bookLabelDao
.
deleteById
(
labelId
);
}
@Override
public
void
updateLabelSeq
(
Long
labelId
,
Integer
seq
)
{
BookLabel
updateLabel
=
new
BookLabel
();
updateLabel
.
setId
(
labelId
);
updateLabel
.
setSeq
(
seq
);
bookLabelDao
.
update
(
updateLabel
);
}
@Override
public
PageBeanNew
<
BookLabelVO
>
listAuditPassBookLabel
(
Integer
labelType
,
Integer
currentPage
,
Integer
numPerPage
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"type"
,
labelType
);
map
.
put
(
"auditState"
,
BookLabelAuditState
.
pass
.
code
);
PageBeanNew
<
BookLabelVO
>
pageBeanNew
=
bookLabelDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
map
,
"listBookLabel"
);
return
pageBeanNew
;
}
@Override
public
PageBeanNew
<
BookLabelVO
>
listApplyBookLabel
(
Integer
labelType
,
Integer
currentPage
,
Integer
numPerPage
,
String
name
,
String
startTime
,
String
endTime
,
Integer
auditState
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"type"
,
labelType
);
map
.
put
(
"name"
,
name
);
map
.
put
(
"startTime"
,
startTime
);
map
.
put
(
"endTime"
,
endTime
);
map
.
put
(
"filterApply"
,
1
);
map
.
put
(
"auditState"
,
auditState
);
PageBeanNew
<
BookLabelVO
>
pageBeanNew
=
bookLabelDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
map
,
"listBookLabel"
);
return
pageBeanNew
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/book/dao/BookLabelDao.java
View file @
825dfd2f
...
...
@@ -10,9 +10,11 @@ public interface BookLabelDao extends BaseDao<BookLabel> {
List
<
BookLabel
>
getListByType
(
Integer
type
);
List
<
BookLabel
>
getAll
();
List
<
BookLabel
>
getAll
(
Long
partyId
);
Map
<
Long
,
BookLabel
>
getMapByIds
(
List
<
Long
>
list
);
Long
getByNameType
(
String
name
,
Integer
type
);
Integer
getMaxSeqByType
(
Integer
type
);
}
pcloud-service-book/src/main/java/com/pcloud/book/book/dao/impl/BookLabelDaoImpl.java
View file @
825dfd2f
...
...
@@ -24,8 +24,10 @@ public class BookLabelDaoImpl extends BaseDaoImpl<BookLabel> implements BookLabe
}
@Override
public
List
<
BookLabel
>
getAll
()
{
return
super
.
getSqlSession
().
selectList
(
super
.
getStatement
(
"getAll"
));
public
List
<
BookLabel
>
getAll
(
Long
partyId
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"createUser"
,
partyId
);
return
super
.
getSqlSession
().
selectList
(
super
.
getStatement
(
"getAll"
),
map
);
}
@Override
...
...
@@ -40,4 +42,9 @@ public class BookLabelDaoImpl extends BaseDaoImpl<BookLabel> implements BookLabe
map
.
put
(
"type"
,
type
);
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getByNameType"
),
map
);
}
@Override
public
Integer
getMaxSeqByType
(
Integer
type
)
{
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getMaxSeqByType"
),
type
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/book/entity/BookLabel.java
View file @
825dfd2f
package
com
.
pcloud
.
book
.
book
.
entity
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.pcloud.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
/**
* @Description
* @Author ruansiyuan
...
...
@@ -19,4 +22,26 @@ public class BookLabel extends BaseEntity {
@ApiModelProperty
(
"标签类型"
)
private
Integer
type
;
@ApiModelProperty
(
"创建人"
)
private
Long
createUser
;
@ApiModelProperty
(
"审核状态(0待审核1通过2修改入库3未通过)"
)
private
Integer
auditState
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
"创建时间"
)
private
Date
createTime
;
@ApiModelProperty
(
"修改入库的标签id"
)
private
Long
updateLabelId
;
@ApiModelProperty
(
"申请说明"
)
private
String
remark
;
@ApiModelProperty
(
"排序值"
)
private
Integer
seq
;
}
pcloud-service-book/src/main/java/com/pcloud/book/book/enums/BookLabelAuditState.java
0 → 100644
View file @
825dfd2f
package
com
.
pcloud
.
book
.
book
.
enums
;
/**
* 书刊标签审核状态
*/
public
enum
BookLabelAuditState
{
/**
* 待审核
*/
wait
(
0
),
/**
* 审核通过
*/
pass
(
1
),
/**
* 修改后通过
*/
update_pass
(
2
),
/**
* 拒绝通过
*/
reject
(
3
);
public
Integer
code
;
public
Integer
getCode
()
{
return
code
;
}
BookLabelAuditState
(
Integer
code
)
{
this
.
code
=
code
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/book/facade/impl/BookFacadeImpl.java
View file @
825dfd2f
...
...
@@ -894,8 +894,8 @@ public class BookFacadeImpl implements BookFacade {
public
ResponseDto
<?>
getBookLabels
(
@RequestHeader
(
"token"
)
String
token
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
return
new
ResponseDto
<>(
bookBiz
.
getBookLabels
());
Long
partyId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
return
new
ResponseDto
<>(
bookBiz
.
getBookLabels
(
partyId
));
}
/**
...
...
pcloud-service-book/src/main/java/com/pcloud/book/book/facade/impl/BookLabelFacadeImpl.java
0 → 100644
View file @
825dfd2f
package
com
.
pcloud
.
book
.
book
.
facade
.
impl
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.book.biz.BookLabelBiz
;
import
com.pcloud.book.book.entity.BookLabel
;
import
com.pcloud.book.book.enums.BookLabelAuditState
;
import
com.pcloud.book.book.vo.BookLabelVO
;
import
com.pcloud.common.core.constant.SystemCode
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.permission.PermissionException
;
import
com.pcloud.common.utils.SessionUtil
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.usercenter.common.exception.BookcaseException
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
@Api
(
"书刊标签"
)
@RequestMapping
(
"bookLabel"
)
@RestController
public
class
BookLabelFacadeImpl
{
@Autowired
private
BookLabelBiz
bookLabelBiz
;
@ApiOperation
(
"申请书刊标签"
)
@PostMapping
(
"applyBookLabel"
)
public
ResponseDto
<?>
applyBookLabel
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
@ApiParam
(
"标签"
)
BookLabel
bookLabel
)
throws
PermissionException
{
if
(
null
==
bookLabel
||
StringUtil
.
isEmpty
(
bookLabel
.
getName
())
||
null
==
bookLabel
.
getType
()){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"缺少标签名称或类型"
);
}
Long
partyId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
String
systemCode
=
(
String
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
SYSTEM_CODE
);
bookLabel
.
setCreateUser
(
partyId
);
bookLabel
.
setName
(
bookLabel
.
getName
().
trim
());
bookLabelBiz
.
applyBookLabel
(
bookLabel
,
systemCode
);
return
new
ResponseDto
<>();
}
@ApiOperation
(
"书刊标签审核"
)
@PostMapping
(
"auditBookLabel"
)
public
ResponseDto
<?>
auditBookLabel
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
@ApiParam
(
"书刊标签"
)
BookLabelVO
bookLabelVO
)
throws
PermissionException
{
if
(
null
==
bookLabelVO
||
null
==
bookLabelVO
.
getLabelId
()
||
null
==
bookLabelVO
.
getAuditState
()){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"缺少标签id或审核状态"
);
}
if
(
BookLabelAuditState
.
update_pass
.
code
.
equals
(
bookLabelVO
.
getAuditState
())
&&
(
null
==
bookLabelVO
.
getType
()
||
StringUtil
.
isEmpty
(
bookLabelVO
.
getName
()))){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"修改后入库缺少标签名称或类型"
);
}
String
systemCode
=
(
String
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
SYSTEM_CODE
);
if
(!
SystemCode
.
pcloud
.
code
.
equalsIgnoreCase
(
systemCode
)){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"非平台端账号不能操作"
);
}
if
(!
StringUtil
.
isEmpty
(
bookLabelVO
.
getName
())){
bookLabelVO
.
setName
(
bookLabelVO
.
getName
().
trim
());
}
bookLabelBiz
.
auditBookLabel
(
bookLabelVO
);
return
new
ResponseDto
<>();
}
@ApiOperation
(
"书刊标签删除"
)
@GetMapping
(
"deleteById"
)
public
ResponseDto
<?>
deleteById
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
"labelId"
)
@ApiParam
(
"标签id"
)
Long
labelId
)
throws
PermissionException
{
String
systemCode
=
(
String
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
SYSTEM_CODE
);
if
(!
SystemCode
.
pcloud
.
code
.
equalsIgnoreCase
(
systemCode
)){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"非平台端账号不能操作"
);
}
bookLabelBiz
.
deleteById
(
labelId
);
return
new
ResponseDto
<>();
}
@ApiOperation
(
"书刊标签修改排序值"
)
@GetMapping
(
"updateLabelSeq"
)
public
ResponseDto
<?>
updateLabelSeq
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
"labelId"
)
@ApiParam
(
"标签id"
)
Long
labelId
,
@RequestParam
(
"seq"
)
@ApiParam
(
"标签排序值"
)
Integer
seq
)
throws
PermissionException
{
String
systemCode
=
(
String
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
SYSTEM_CODE
);
if
(!
SystemCode
.
pcloud
.
code
.
equalsIgnoreCase
(
systemCode
)){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"非平台端账号不能操作"
);
}
bookLabelBiz
.
updateLabelSeq
(
labelId
,
seq
);
return
new
ResponseDto
<>();
}
@ApiOperation
(
"审核通过的标签列表"
)
@GetMapping
(
"listAuditPassBookLabel"
)
public
ResponseDto
<
PageBeanNew
<
BookLabelVO
>>
listAuditPassBookLabel
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"labelType"
,
required
=
false
)
@ApiParam
(
"标签类型:1年级,2科目,3版本,4地域"
)
Integer
labelType
,
@RequestParam
(
"currentPage"
)
@ApiParam
(
"当前页"
)
Integer
currentPage
,
@RequestParam
(
"numPerPage"
)
@ApiParam
(
"每页数量"
)
Integer
numPerPage
)
throws
PermissionException
{
String
systemCode
=
(
String
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
SYSTEM_CODE
);
if
(!
SystemCode
.
pcloud
.
code
.
equalsIgnoreCase
(
systemCode
)){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"非平台端账号不能操作"
);
}
if
(
null
==
currentPage
||
null
==
numPerPage
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"分页参数错误"
);
}
PageBeanNew
<
BookLabelVO
>
pageBeanNew
=
bookLabelBiz
.
listAuditPassBookLabel
(
labelType
,
currentPage
,
numPerPage
);
return
new
ResponseDto
<>(
pageBeanNew
);
}
@ApiOperation
(
"标签管理列表"
)
@GetMapping
(
"listApplyBookLabel"
)
public
ResponseDto
<
PageBeanNew
<
BookLabelVO
>>
listApplyBookLabel
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"labelType"
,
required
=
false
)
@ApiParam
(
"标签类型:1年级,2科目,3版本,4地域"
)
Integer
labelType
,
@RequestParam
(
"currentPage"
)
@ApiParam
(
"当前页"
)
Integer
currentPage
,
@RequestParam
(
"numPerPage"
)
@ApiParam
(
"每页数量"
)
Integer
numPerPage
,
@RequestParam
(
value
=
"name"
,
required
=
false
)
@ApiParam
(
"标签名称"
)
String
name
,
@RequestParam
(
value
=
"startTime"
,
required
=
false
)
@ApiParam
(
"开始时间"
)
String
startTime
,
@RequestParam
(
value
=
"endTime"
,
required
=
false
)
@ApiParam
(
"结束时间"
)
String
endTime
,
@RequestParam
(
value
=
"auditState"
,
required
=
false
)
@ApiParam
(
"审核状态(0待审核1通过2修改入库3未通过)"
)
Integer
auditState
)
throws
PermissionException
{
String
systemCode
=
(
String
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
SYSTEM_CODE
);
if
(!
SystemCode
.
pcloud
.
code
.
equalsIgnoreCase
(
systemCode
)){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"非平台端账号不能操作"
);
}
if
(
null
==
currentPage
||
null
==
numPerPage
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"分页参数错误"
);
}
PageBeanNew
<
BookLabelVO
>
pageBeanNew
=
bookLabelBiz
.
listApplyBookLabel
(
labelType
,
currentPage
,
numPerPage
,
name
,
startTime
,
endTime
,
auditState
);
return
new
ResponseDto
<>(
pageBeanNew
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/book/vo/BookLabelVO.java
0 → 100644
View file @
825dfd2f
package
com
.
pcloud
.
book
.
book
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.pcloud.common.dto.BaseDto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
/**
* 书刊标签
*/
@Data
@ApiModel
(
"书刊标签"
)
public
class
BookLabelVO
extends
BaseDto
{
@ApiModelProperty
(
"标签id"
)
private
Long
labelId
;
@ApiModelProperty
(
"审核状态(0待审核1通过2修改入库3未通过)"
)
private
Integer
auditState
;
@ApiModelProperty
(
"标签名称"
)
private
String
name
;
@ApiModelProperty
(
"标签类型"
)
private
Integer
type
;
@ApiModelProperty
(
"排序值"
)
private
Integer
seq
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
"创建时间"
)
private
Date
createTime
;
@ApiModelProperty
(
"申请说明"
)
private
String
remark
;
}
pcloud-service-book/src/main/resources/mapper/book/BookLabel.Mapper.xml
View file @
825dfd2f
...
...
@@ -6,12 +6,60 @@
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"name"
property=
"name"
jdbcType=
"VARCHAR"
/>
<result
column=
"type"
property=
"type"
jdbcType=
"INTEGER"
/>
<result
column=
"create_user"
property=
"createUser"
jdbcType=
"BIGINT"
/>
<result
column=
"audit_state"
property=
"auditState"
jdbcType=
"INTEGER"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_label_id"
property=
"updateLabelId"
jdbcType=
"BIGINT"
/>
<result
column=
"remark"
property=
"remark"
jdbcType=
"VARCHAR"
/>
<result
column=
"seq"
property=
"seq"
jdbcType=
"INTEGER"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id,`name`,`type`
id,`name`,`type`
, create_user, audit_state, create_time, update_label_id, remark, seq
</sql>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.book.entity.BookLabel"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into book_label
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
`name`,`type`, create_user, audit_state, create_time, remark, seq
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
#{name},
#{type,jdbcType=INTEGER},
#{createUser},
#{auditState,jdbcType=INTEGER},
NOW(),
#{remark},
#{seq}
</trim>
</insert>
<update
id=
"update"
parameterType=
"com.pcloud.book.book.entity.BookLabel"
>
update book_label
<set>
<if
test=
"auditState != null"
>
audit_state = #{auditState,jdbcType=INTEGER},
</if>
<if
test=
"updateLabelId != null"
>
update_label_id = #{updateLabelId},
</if>
<if
test=
"seq != null"
>
seq = #{seq},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<delete
id=
"deleteById"
parameterType=
"long"
>
delete from
book_label
where id = #{id,jdbcType=BIGINT}
</delete>
<select
id=
"getMaxSeqByType"
parameterType=
"integer"
resultType=
"integer"
>
SELECT MAX(seq) FROM book_label WHERE type=#{type}
</select>
<select
id=
"getListByType"
parameterType=
"integer"
resultMap=
"BaseResultMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
...
...
@@ -21,9 +69,14 @@
</select>
<!--获取全部-->
<select
id=
"getAll"
resultMap=
"BaseResultMap"
>
<select
id=
"getAll"
resultMap=
"BaseResultMap"
parameterType=
"map"
>
select
<include
refid=
"Base_Column_List"
/>
from book_label
WHERE audit_state=1
<if
test=
"createUser >0 "
>
OR create_user = #{createUser}
</if>
ORDER BY type ASC, seq ASC, id ASC
</select>
<!--根据id查询map-->
...
...
@@ -42,4 +95,37 @@
AND type = #{type}
LIMIT 1
</select>
<select
id=
"listBookLabel"
parameterType=
"map"
resultType=
"com.pcloud.book.book.vo.BookLabelVO"
>
select
id labelId,
`name` name,
type type,
audit_state auditState,
seq seq,
create_time createTime,
remark AS remark
from book_label
WHERE 1=1
<if
test=
"auditState != null"
>
and audit_state = #{auditState}
</if>
<if
test=
"type != null"
>
AND type = #{type}
</if>
<if
test=
"name != null"
>
AND `name` LIKE CONCAT('%',#{name},'%')
</if>
<if
test=
"startTime != null"
>
AND create_time >= #{startTime}
</if>
<if
test=
"endTime != null"
>
AND create_time
<
= #{endTime}
</if>
<if
test=
" filterApply == 1"
>
AND create_user>0
</if>
ORDER BY type ASC, seq ASC, id ASC
</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