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
eff739b4
Commit
eff739b4
authored
Jun 20, 2022
by
zhangyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:[none] 优化书刊活动开关接口
parent
2e65cc1b
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
448 additions
and
4 deletions
+448
-4
BookDto.java
...-book/src/main/java/com/pcloud/book/book/dto/BookDto.java
+26
-0
BookSwitch.java
...src/main/java/com/pcloud/book/book/entity/BookSwitch.java
+51
-0
BookService.java
...c/main/java/com/pcloud/book/book/service/BookService.java
+14
-0
BookSwitchBiz.java
...src/main/java/com/pcloud/book/book/biz/BookSwitchBiz.java
+21
-0
BookElasticSearchBizImpl.java
...m/pcloud/book/book/biz/impl/BookElasticSearchBizImpl.java
+13
-4
BookSwitchBizImpl.java
...java/com/pcloud/book/book/biz/impl/BookSwitchBizImpl.java
+78
-0
BookSwitchFacade.java
...in/java/com/pcloud/book/book/facade/BookSwitchFacade.java
+49
-0
BookSwitchMapper.java
...in/java/com/pcloud/book/book/mapper/BookSwitchMapper.java
+26
-0
BookServiceImpl.java
...va/com/pcloud/book/book/service/impl/BookServiceImpl.java
+10
-0
BookSwitchParam.java
...java/com/pcloud/book/book/vo/request/BookSwitchParam.java
+23
-0
BookSwitchMapper.xml
...-book/src/main/resources/mapper/book/BookSwitchMapper.xml
+137
-0
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/book/dto/BookDto.java
View file @
eff739b4
...
@@ -874,6 +874,16 @@ public class BookDto extends BaseDto {
...
@@ -874,6 +874,16 @@ public class BookDto extends BaseDto {
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
thawTime
;
private
Date
thawTime
;
/**
* 是否开启盲盒抽奖
*/
private
Integer
isBlackBoxEnable
;
/**
* 是否开启资源分享
*/
private
Integer
isResShareEnable
;
public
Date
getFreezetime
()
{
public
Date
getFreezetime
()
{
return
freezetime
;
return
freezetime
;
}
}
...
@@ -1672,6 +1682,22 @@ public class BookDto extends BaseDto {
...
@@ -1672,6 +1682,22 @@ public class BookDto extends BaseDto {
this
.
bookNum
=
bookNum
;
this
.
bookNum
=
bookNum
;
}
}
public
Integer
getIsBlackBoxEnable
()
{
return
isBlackBoxEnable
;
}
public
void
setIsBlackBoxEnable
(
Integer
isBlackBoxEnable
)
{
this
.
isBlackBoxEnable
=
isBlackBoxEnable
;
}
public
Integer
getIsResShareEnable
()
{
return
isResShareEnable
;
}
public
void
setIsResShareEnable
(
Integer
isResShareEnable
)
{
this
.
isResShareEnable
=
isResShareEnable
;
}
public
String
getPrograma
()
{
public
String
getPrograma
()
{
return
programa
;
return
programa
;
}
}
...
...
pcloud-facade-book/src/main/java/com/pcloud/book/book/entity/BookSwitch.java
0 → 100644
View file @
eff739b4
package
com
.
pcloud
.
book
.
book
.
entity
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* book_switch
* @author
*/
@Data
public
class
BookSwitch
implements
Serializable
{
/**
* 书刊活动开关表
*/
private
Long
bookId
;
/**
* 是否开启盲盒抽奖
*/
private
Integer
isBlackBoxEnable
;
/**
* 是否开启资源分享
*/
private
Integer
isResShareEnable
;
/**
* 修改人
*/
private
Long
updateUser
;
/**
* 修改时间
*/
private
Date
updateTime
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 创建人
*/
private
Long
createUser
;
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
pcloud-facade-book/src/main/java/com/pcloud/book/book/service/BookService.java
View file @
eff739b4
...
@@ -11,6 +11,7 @@ import com.pcloud.book.book.dto.BookInfo4AnlysicsDTO;
...
@@ -11,6 +11,7 @@ import com.pcloud.book.book.dto.BookInfo4AnlysicsDTO;
import
com.pcloud.book.book.dto.BookInfoAnalysicsDTO
;
import
com.pcloud.book.book.dto.BookInfoAnalysicsDTO
;
import
com.pcloud.book.book.dto.BookInfoAndAuthStatusDTO
;
import
com.pcloud.book.book.dto.BookInfoAndAuthStatusDTO
;
import
com.pcloud.book.book.dto.BookMinimumSupportDTO4Service
;
import
com.pcloud.book.book.dto.BookMinimumSupportDTO4Service
;
import
com.pcloud.book.book.entity.BookSwitch
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.page.PageBean
;
import
com.pcloud.common.page.PageBean
;
...
@@ -54,6 +55,19 @@ public interface BookService {
...
@@ -54,6 +55,19 @@ public interface BookService {
throws
BizException
;
throws
BizException
;
/**
/**
* 批量获取书籍活动开关信息
*
* @param bookIds
* @return
* @throws BizException
*/
@ApiOperation
(
value
=
"批量获取书籍活动开关信息"
,
httpMethod
=
"POST"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"bookIds"
,
value
=
"图书id集合"
,
dataType
=
"List<Long>"
,
paramType
=
"body"
)})
@RequestMapping
(
value
=
"/mapSwitchByBookIds"
,
method
=
RequestMethod
.
POST
)
ResponseEntity
<
ResponseDto
<
Map
<
Long
,
BookSwitch
>>>
mapSwitchByBookIds
(
@RequestBody
(
required
=
false
)
List
<
Long
>
bookIds
)
throws
BizException
;
/**
* 批量获取书籍信息
* 批量获取书籍信息
*
*
* @param bookIds
* @param bookIds
...
...
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/BookSwitchBiz.java
0 → 100644
View file @
eff739b4
package
com
.
pcloud
.
book
.
book
.
biz
;
import
com.pcloud.book.book.entity.BookSwitch
;
import
com.pcloud.book.book.vo.request.BookSwitchParam
;
import
java.util.List
;
import
java.util.Map
;
/**
* @描述:
* @作者:张扬
* @创建时间:2022/6/17 21:05:11
* @版本:1.0
*/
public
interface
BookSwitchBiz
{
void
saveSwitch
(
BookSwitchParam
param
);
Map
<
Long
,
BookSwitch
>
mapByBookIds
(
List
<
Long
>
bookIds
);
void
batchSaveSwitch
(
BookSwitchParam
param
);
}
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookElasticSearchBizImpl.java
View file @
eff739b4
...
@@ -2,10 +2,12 @@ package com.pcloud.book.book.biz.impl;
...
@@ -2,10 +2,12 @@ package com.pcloud.book.book.biz.impl;
import
com.pcloud.book.base.enums.BookFreezeEnum
;
import
com.pcloud.book.base.enums.BookFreezeEnum
;
import
com.pcloud.book.book.biz.BookBiz
;
import
com.pcloud.book.book.biz.BookBiz
;
import
com.pcloud.book.book.biz.BookSwitchBiz
;
import
com.pcloud.book.book.dao.BookTypeDao
;
import
com.pcloud.book.book.dao.BookTypeDao
;
import
com.pcloud.book.book.dto.BookDto
;
import
com.pcloud.book.book.dto.BookDto
;
import
com.pcloud.book.book.dto.BookFundDto
;
import
com.pcloud.book.book.dto.BookFundDto
;
import
com.pcloud.book.book.dto.BookTypeDto
;
import
com.pcloud.book.book.dto.BookTypeDto
;
import
com.pcloud.book.book.entity.BookSwitch
;
import
com.pcloud.book.consumer.book.elasticsearch.BookElasticSearchConsr
;
import
com.pcloud.book.consumer.book.elasticsearch.BookElasticSearchConsr
;
import
com.pcloud.book.consumer.user.PartyConsr
;
import
com.pcloud.book.consumer.user.PartyConsr
;
import
com.pcloud.book.elasticsearch7.domain.dto.param.PlatformSearchDto
;
import
com.pcloud.book.elasticsearch7.domain.dto.param.PlatformSearchDto
;
...
@@ -25,6 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -25,6 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@Service
@Service
public
class
BookElasticSearchBizImpl
{
public
class
BookElasticSearchBizImpl
{
...
@@ -41,6 +44,9 @@ public class BookElasticSearchBizImpl {
...
@@ -41,6 +44,9 @@ public class BookElasticSearchBizImpl {
@Autowired
@Autowired
private
BookBiz
bookBiz
;
private
BookBiz
bookBiz
;
@Autowired
private
BookSwitchBiz
bookSwitchBiz
;
public
PageBeanNew
<
BookDto
>
getListPage
(
PlatformSearchDto
dto
)
throws
BizException
{
public
PageBeanNew
<
BookDto
>
getListPage
(
PlatformSearchDto
dto
)
throws
BizException
{
if
(!
StringUtil
.
isEmpty
(
dto
.
getIsbn
())
&&
StringUtils
.
isNumeric
(
dto
.
getIsbn
()))
{
if
(!
StringUtil
.
isEmpty
(
dto
.
getIsbn
())
&&
StringUtils
.
isNumeric
(
dto
.
getIsbn
()))
{
...
@@ -58,8 +64,9 @@ public class BookElasticSearchBizImpl {
...
@@ -58,8 +64,9 @@ public class BookElasticSearchBizImpl {
if
(
CollectionUtils
.
isNotEmpty
(
esResult
.
getList
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
esResult
.
getList
()))
{
Map
<
Long
,
String
>
pcloudUserMap
=
partyConsr
.
getAllUserLoginName
(
0L
,
SystemCode
.
pcloud
.
code
);
Map
<
Long
,
String
>
pcloudUserMap
=
partyConsr
.
getAllUserLoginName
(
0L
,
SystemCode
.
pcloud
.
code
);
Map
<
String
,
BookTypeDto
>
typeCodeMap
=
bookTypeDao
.
getTypeCodeMap
();
Map
<
String
,
BookTypeDto
>
typeCodeMap
=
bookTypeDao
.
getTypeCodeMap
();
List
<
Long
>
bookIds
=
esResult
.
getList
().
stream
().
map
(
e
->
e
.
getBookId
()).
collect
(
Collectors
.
toList
());
esResult
.
getList
().
forEach
((
esBook
)
->
bookList
.
add
(
doBookProcess
(
esBook
,
pcloudUserMap
,
typeCodeMap
)));
Map
<
Long
,
BookSwitch
>
bookSwitchMap
=
bookSwitchBiz
.
mapByBookIds
(
bookIds
);
esResult
.
getList
().
forEach
((
esBook
)
->
bookList
.
add
(
doBookProcess
(
esBook
,
pcloudUserMap
,
typeCodeMap
,
bookSwitchMap
)));
}
}
PageBeanNew
<
BookDto
>
result
=
new
PageBeanNew
<>();
PageBeanNew
<
BookDto
>
result
=
new
PageBeanNew
<>();
...
@@ -74,7 +81,7 @@ public class BookElasticSearchBizImpl {
...
@@ -74,7 +81,7 @@ public class BookElasticSearchBizImpl {
return
bookBiz
.
checkIsBookId
(
isbnNumber
);
return
bookBiz
.
checkIsBookId
(
isbnNumber
);
}
}
private
BookDto
doBookProcess
(
Es7Book
esBook
,
Map
<
Long
,
String
>
pcloudUserMap
,
Map
<
String
,
BookTypeDto
>
typeCodeMap
)
{
private
BookDto
doBookProcess
(
Es7Book
esBook
,
Map
<
Long
,
String
>
pcloudUserMap
,
Map
<
String
,
BookTypeDto
>
typeCodeMap
,
Map
<
Long
,
BookSwitch
>
bookSwitchMap
)
{
BookDto
bookDto
=
Converter
.
convert
(
esBook
);
BookDto
bookDto
=
Converter
.
convert
(
esBook
);
Integer
freezeStatus
=
BookFreezeEnum
.
WAIT_FREEZE
.
value
;
Integer
freezeStatus
=
BookFreezeEnum
.
WAIT_FREEZE
.
value
;
...
@@ -115,7 +122,9 @@ public class BookElasticSearchBizImpl {
...
@@ -115,7 +122,9 @@ public class BookElasticSearchBizImpl {
freezeStatus
,
BookFreezeEnum
.
FREEZE
.
value
));
freezeStatus
,
BookFreezeEnum
.
FREEZE
.
value
));
bookDto
.
setIsHaveAdviser
(
esBook
.
getIsAdviserBook
()
&&
!
esBook
.
getIsBookAdviserDelete
());
bookDto
.
setIsHaveAdviser
(
esBook
.
getIsAdviserBook
()
&&
!
esBook
.
getIsBookAdviserDelete
());
BookSwitch
bookSwitch
=
bookSwitchMap
.
get
(
bookDto
.
getBookId
());
bookDto
.
setIsBlackBoxEnable
(
bookSwitch
==
null
?
0
:
bookSwitch
.
getIsBlackBoxEnable
());
bookDto
.
setIsResShareEnable
(
bookSwitch
==
null
?
0
:
bookSwitch
.
getIsResShareEnable
());
BookTypeDto
bookTypeDto
=
MapUtils
.
getObject
(
typeCodeMap
,
bookDto
.
getTypeCode
());
BookTypeDto
bookTypeDto
=
MapUtils
.
getObject
(
typeCodeMap
,
bookDto
.
getTypeCode
());
bookDto
.
setTypeName
(
Optional
.
ofNullable
(
bookTypeDto
).
orElseGet
(
BookTypeDto:
:
new
).
getTypeName
());
bookDto
.
setTypeName
(
Optional
.
ofNullable
(
bookTypeDto
).
orElseGet
(
BookTypeDto:
:
new
).
getTypeName
());
...
...
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookSwitchBizImpl.java
0 → 100644
View file @
eff739b4
package
com
.
pcloud
.
book
.
book
.
biz
.
impl
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.map.MapUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.pcloud.book.book.biz.BookSwitchBiz
;
import
com.pcloud.book.book.entity.BookSwitch
;
import
com.pcloud.book.book.mapper.BookSwitchMapper
;
import
com.pcloud.book.book.vo.request.BookSwitchParam
;
import
com.pcloud.common.exceptions.BizException
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
/**
* @描述:
* @作者:张扬
* @创建时间:2022/6/17 21:06:02
* @版本:1.0
*/
@Component
public
class
BookSwitchBizImpl
implements
BookSwitchBiz
{
@Resource
private
BookSwitchMapper
bookSwitchMapper
;
@Override
public
void
saveSwitch
(
BookSwitchParam
param
)
{
if
(
ObjectUtil
.
isEmpty
(
param
.
getBookId
())
||
ObjectUtil
.
isAllEmpty
(
param
.
getIsBlackBoxEnable
(),
param
.
getIsResShareEnable
()))
{
throw
BizException
.
PARAM_DELETION
;
}
bookSwitchMapper
.
insertSelective
(
buildBookSwitch
(
param
));
}
@Override
public
Map
<
Long
,
BookSwitch
>
mapByBookIds
(
List
<
Long
>
bookIds
)
{
if
(
CollUtil
.
isEmpty
(
bookIds
))
{
return
MapUtil
.
empty
();
}
List
<
BookSwitch
>
datas
=
bookSwitchMapper
.
listByBookIds
(
bookIds
);
if
(
CollUtil
.
isEmpty
(
datas
))
{
return
MapUtil
.
empty
();
}
return
datas
.
stream
().
collect
(
Collectors
.
toMap
(
BookSwitch:
:
getBookId
,
Function
.
identity
()));
}
@Override
public
void
batchSaveSwitch
(
BookSwitchParam
param
)
{
List
<
BookSwitchParam
>
switchList
=
param
.
getSwitchList
();
if
(
CollUtil
.
isEmpty
(
switchList
))
{
throw
BizException
.
PARAM_DELETION
;
}
List
<
BookSwitch
>
bookSwitches
=
new
ArrayList
<>();
for
(
BookSwitchParam
val
:
switchList
)
{
if
(
val
==
null
||
ObjectUtil
.
hasEmpty
(
val
.
getBookId
(),
val
.
getIsBlackBoxEnable
(),
val
.
getIsResShareEnable
()))
{
throw
BizException
.
PARAM_DELETION
;
}
val
.
setPartyId
(
param
.
getPartyId
());
bookSwitches
.
add
(
buildBookSwitch
(
val
));
}
bookSwitchMapper
.
batchInsert
(
bookSwitches
);
}
private
BookSwitch
buildBookSwitch
(
BookSwitchParam
param
)
{
BookSwitch
bookSwitch
=
new
BookSwitch
();
bookSwitch
.
setBookId
(
param
.
getBookId
());
bookSwitch
.
setIsBlackBoxEnable
(
param
.
getIsBlackBoxEnable
());
bookSwitch
.
setIsResShareEnable
(
param
.
getIsResShareEnable
());
bookSwitch
.
setCreateUser
(
param
.
getPartyId
());
bookSwitch
.
setUpdateUser
(
param
.
getPartyId
());
return
bookSwitch
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/book/facade/BookSwitchFacade.java
0 → 100644
View file @
eff739b4
package
com
.
pcloud
.
book
.
book
.
facade
;
import
com.pcloud.book.book.biz.BookCoverBiz
;
import
com.pcloud.book.book.biz.BookSwitchBiz
;
import
com.pcloud.book.book.dto.BookCoverDTO
;
import
com.pcloud.book.book.entity.BookSwitch
;
import
com.pcloud.book.book.vo.request.BookSwitchParam
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.utils.SessionUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestHeader
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.Map
;
@RestController
@Api
(
description
=
"图书活动开关服务"
)
public
class
BookSwitchFacade
{
@Autowired
private
BookSwitchBiz
bookSwitchBiz
;
@ApiOperation
(
"保存开关"
)
@RequestMapping
(
value
=
"/book/saveSwitch"
,
method
=
RequestMethod
.
POST
)
public
ResponseDto
<?>
saveSwitch
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
BookSwitchParam
param
)
{
Long
partyId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
param
.
setPartyId
(
partyId
);
bookSwitchBiz
.
saveSwitch
(
param
);
return
new
ResponseDto
<>();
}
@ApiOperation
(
"批量保存开关"
)
@RequestMapping
(
value
=
"/book/batchSaveSwitch"
,
method
=
RequestMethod
.
POST
)
public
ResponseDto
<?>
batchSaveSwitch
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
BookSwitchParam
param
)
{
Long
partyId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
param
.
setPartyId
(
partyId
);
bookSwitchBiz
.
batchSaveSwitch
(
param
);
return
new
ResponseDto
<>();
}
}
pcloud-service-book/src/main/java/com/pcloud/book/book/mapper/BookSwitchMapper.java
0 → 100644
View file @
eff739b4
package
com
.
pcloud
.
book
.
book
.
mapper
;
import
com.pcloud.book.book.entity.BookSwitch
;
import
java.util.List
;
public
interface
BookSwitchMapper
{
int
deleteByPrimaryKey
(
Long
bookId
);
int
insert
(
BookSwitch
record
);
int
insertSelective
(
BookSwitch
record
);
BookSwitch
selectByPrimaryKey
(
Long
bookId
);
int
updateByPrimaryKeySelective
(
BookSwitch
record
);
int
updateByPrimaryKey
(
BookSwitch
record
);
List
<
BookSwitch
>
listByBookIds
(
List
<
Long
>
bookIds
);
void
batchInsert
(
List
<
BookSwitch
>
bookSwitches
);
void
batchInsertSelective
(
List
<
BookSwitch
>
bookSwitches
);
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/book/service/impl/BookServiceImpl.java
View file @
eff739b4
...
@@ -7,6 +7,7 @@ import com.pcloud.book.book.biz.BookBiz;
...
@@ -7,6 +7,7 @@ import com.pcloud.book.book.biz.BookBiz;
import
com.pcloud.book.book.biz.BookLabelBiz
;
import
com.pcloud.book.book.biz.BookLabelBiz
;
import
com.pcloud.book.book.biz.BookQrcodeWxworkBiz
;
import
com.pcloud.book.book.biz.BookQrcodeWxworkBiz
;
import
com.pcloud.book.book.biz.BookMinimumSupportBiz
;
import
com.pcloud.book.book.biz.BookMinimumSupportBiz
;
import
com.pcloud.book.book.biz.BookSwitchBiz
;
import
com.pcloud.book.book.dto.AviserBookInfoParam
;
import
com.pcloud.book.book.dto.AviserBookInfoParam
;
import
com.pcloud.book.book.dto.BookAdviserUpdateTimeDTO
;
import
com.pcloud.book.book.dto.BookAdviserUpdateTimeDTO
;
import
com.pcloud.book.book.dto.BookDetialDTO
;
import
com.pcloud.book.book.dto.BookDetialDTO
;
...
@@ -14,6 +15,7 @@ import com.pcloud.book.book.dto.BookDto;
...
@@ -14,6 +15,7 @@ import com.pcloud.book.book.dto.BookDto;
import
com.pcloud.book.book.dto.BookInfo4AnlysicsDTO
;
import
com.pcloud.book.book.dto.BookInfo4AnlysicsDTO
;
import
com.pcloud.book.book.dto.BookInfoAnalysicsDTO
;
import
com.pcloud.book.book.dto.BookInfoAnalysicsDTO
;
import
com.pcloud.book.book.dto.BookInfoAndAuthStatusDTO
;
import
com.pcloud.book.book.dto.BookInfoAndAuthStatusDTO
;
import
com.pcloud.book.book.entity.BookSwitch
;
import
com.pcloud.book.book.enums.WxworkQrcodeType
;
import
com.pcloud.book.book.enums.WxworkQrcodeType
;
import
com.pcloud.book.book.dto.BookMinimumSupportDTO4Service
;
import
com.pcloud.book.book.dto.BookMinimumSupportDTO4Service
;
import
com.pcloud.book.book.service.BookService
;
import
com.pcloud.book.book.service.BookService
;
...
@@ -54,6 +56,8 @@ public class BookServiceImpl implements BookService {
...
@@ -54,6 +56,8 @@ public class BookServiceImpl implements BookService {
private
BookMinimumSupportBiz
bookMinimumSupportBiz
;
private
BookMinimumSupportBiz
bookMinimumSupportBiz
;
@Autowired
@Autowired
private
BookQrcodeWxworkBiz
bookQrcodeWxworkBiz
;
private
BookQrcodeWxworkBiz
bookQrcodeWxworkBiz
;
@Autowired
private
BookSwitchBiz
bookSwitchBiz
;
/**
/**
* 获取书籍信息
* 获取书籍信息
...
@@ -65,6 +69,12 @@ public class BookServiceImpl implements BookService {
...
@@ -65,6 +69,12 @@ public class BookServiceImpl implements BookService {
return
ResponseHandleUtil
.
toResponse
(
bookBiz
.
getBaseById
(
bookId
));
return
ResponseHandleUtil
.
toResponse
(
bookBiz
.
getBaseById
(
bookId
));
}
}
@Override
@RequestMapping
(
value
=
"/mapSwitchByBookIds"
,
method
=
RequestMethod
.
POST
)
public
ResponseEntity
<
ResponseDto
<
Map
<
Long
,
BookSwitch
>>>
mapSwitchByBookIds
(
@RequestBody
(
required
=
false
)
List
<
Long
>
bookIds
)
throws
BizException
{
return
ResponseHandleUtil
.
toResponse
(
bookSwitchBiz
.
mapByBookIds
(
bookIds
));
}
/**
/**
* 批量获取书籍信息
* 批量获取书籍信息
*/
*/
...
...
pcloud-service-book/src/main/java/com/pcloud/book/book/vo/request/BookSwitchParam.java
0 → 100644
View file @
eff739b4
package
com
.
pcloud
.
book
.
book
.
vo
.
request
;
import
lombok.Data
;
import
java.util.List
;
/**
* @描述:
* @作者:张扬
* @创建时间:2022/6/17 21:08:25
* @版本:1.0
*/
@Data
public
class
BookSwitchParam
{
private
Long
partyId
;
private
Long
bookId
;
private
Integer
isBlackBoxEnable
;
private
Integer
isResShareEnable
;
private
List
<
BookSwitchParam
>
switchList
;
}
pcloud-service-book/src/main/resources/mapper/book/BookSwitchMapper.xml
0 → 100644
View file @
eff739b4
<?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=
"com.pcloud.book.book.mapper.BookSwitchMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.book.entity.BookSwitch"
>
<id
column=
"book_id"
jdbcType=
"BIGINT"
property=
"bookId"
/>
<result
column=
"is_black_box_enable"
jdbcType=
"INTEGER"
property=
"isBlackBoxEnable"
/>
<result
column=
"is_res_share_enable"
jdbcType=
"INTEGER"
property=
"isResShareEnable"
/>
<result
column=
"update_user"
jdbcType=
"BIGINT"
property=
"updateUser"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"create_user"
jdbcType=
"BIGINT"
property=
"createUser"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
book_id, is_black_box_enable, is_res_share_enable, update_user, update_time, create_time,
create_user
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Long"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from book_switch
where book_id = #{bookId,jdbcType=BIGINT}
</select>
<select
id=
"listByBookIds"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from book_switch
where book_id in
<foreach
collection=
"list"
separator=
","
item=
"item"
open=
"("
close=
")"
>
#{item}
</foreach>
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
delete from book_switch
where book_id = #{bookId,jdbcType=BIGINT}
</delete>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.book.entity.BookSwitch"
>
insert into book_switch (book_id,is_black_box_enable, is_res_share_enable,
update_user, update_time, create_time,
create_user)
values (#{bookId,jdbcType=BIGINT},#{isBlackBoxEnable,jdbcType=INTEGER}, #{isResShareEnable,jdbcType=INTEGER},
#{updateUser,jdbcType=BIGINT}, now(), now(),
#{createUser,jdbcType=BIGINT})
on duplicate key update
is_black_box_enable=values(is_black_box_enable),
is_res_share_enable=values(is_res_share_enable),
update_time=now(),
update_user=values(update_user)
</insert>
<insert
id=
"insertSelective"
keyColumn=
"book_id"
keyProperty=
"bookId"
parameterType=
"com.pcloud.book.book.entity.BookSwitch"
useGeneratedKeys=
"true"
>
insert into book_switch
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
book_id,
<if
test=
"isBlackBoxEnable != null"
>
is_black_box_enable,
</if>
<if
test=
"isResShareEnable != null"
>
is_res_share_enable,
</if>
update_user,
update_time,
create_time,
create_user
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
#{bookId},
<if
test=
"isBlackBoxEnable != null"
>
#{isBlackBoxEnable,jdbcType=INTEGER},
</if>
<if
test=
"isResShareEnable != null"
>
#{isResShareEnable,jdbcType=INTEGER},
</if>
#{updateUser,jdbcType=BIGINT},
now(),
now(),
#{createUser,jdbcType=BIGINT}
</trim>
on duplicate key update
<if
test=
"isBlackBoxEnable != null"
>
is_black_box_enable=values(is_black_box_enable),
</if>
<if
test=
"isResShareEnable != null"
>
is_res_share_enable=values(is_res_share_enable),
</if>
update_time=now(),
update_user=values(update_user)
</insert>
<insert
id=
"batchInsert"
parameterType=
"com.pcloud.book.book.entity.BookSwitch"
>
insert into book_switch (book_id,is_black_box_enable, is_res_share_enable,
update_user, update_time, create_time,
create_user)
values
<foreach
collection=
"list"
separator=
","
item=
"item"
>
(#{item.bookId,jdbcType=BIGINT},#{item.isBlackBoxEnable,jdbcType=INTEGER}, #{item.isResShareEnable,jdbcType=INTEGER},
#{item.updateUser,jdbcType=BIGINT}, now(), now(),
#{item.createUser,jdbcType=BIGINT})
</foreach>
on duplicate key update
is_black_box_enable=values(is_black_box_enable),
is_res_share_enable=values(is_res_share_enable),
update_time=now(),
update_user=values(update_user)
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.pcloud.book.book.entity.BookSwitch"
>
update book_switch
<set>
<if
test=
"isBlackBoxEnable != null"
>
is_black_box_enable = #{isBlackBoxEnable,jdbcType=INTEGER},
</if>
<if
test=
"isResShareEnable != null"
>
is_res_share_enable = #{isResShareEnable,jdbcType=INTEGER},
</if>
<if
test=
"updateUser != null"
>
update_user = #{updateUser,jdbcType=BIGINT},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"createUser != null"
>
create_user = #{createUser,jdbcType=BIGINT},
</if>
</set>
where book_id = #{bookId,jdbcType=BIGINT}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.pcloud.book.book.entity.BookSwitch"
>
update book_switch
set is_black_box_enable = #{isBlackBoxEnable,jdbcType=INTEGER},
is_res_share_enable = #{isResShareEnable,jdbcType=INTEGER},
update_user = #{updateUser,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=TIMESTAMP},
create_time = #{createTime,jdbcType=TIMESTAMP},
create_user = #{createUser,jdbcType=BIGINT}
where book_id = #{bookId,jdbcType=BIGINT}
</update>
</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