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
05f160be
Commit
05f160be
authored
Aug 06, 2021
by
郑永强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: [1005196] 视频课作品与题库支持版权保护通过后,通过开关控制收费
parent
2ef92ec1
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
199 additions
and
441 deletions
+199
-441
BookInfoAndAuthStatusDTO.java
...va/com/pcloud/book/book/dto/BookInfoAndAuthStatusDTO.java
+4
-67
BookAuthServeService.java
...m/pcloud/book/copyright/service/BookAuthServeService.java
+5
-0
BookAuthInfoBiz.java
...n/java/com/pcloud/book/copyright/biz/BookAuthInfoBiz.java
+5
-0
BookAuthServeBiz.java
.../java/com/pcloud/book/copyright/biz/BookAuthServeBiz.java
+11
-0
BookAuthInfoBizImpl.java
...m/pcloud/book/copyright/biz/impl/BookAuthInfoBizImpl.java
+22
-0
BookAuthServeBizImpl.java
.../pcloud/book/copyright/biz/impl/BookAuthServeBizImpl.java
+50
-0
BookAuthUserBizImpl.java
...m/pcloud/book/copyright/biz/impl/BookAuthUserBizImpl.java
+16
-2
BookAuthInfoDao.java
...n/java/com/pcloud/book/copyright/dao/BookAuthInfoDao.java
+5
-0
BookAuthInfoDaoImpl.java
...m/pcloud/book/copyright/dao/impl/BookAuthInfoDaoImpl.java
+9
-0
BookAuthInfo.java
...n/java/com/pcloud/book/copyright/entity/BookAuthInfo.java
+4
-168
BookAuthInfoFacadeImpl.java
...ud/book/copyright/facade/impl/BookAuthInfoFacadeImpl.java
+9
-0
BookAuthServeServiceImpl.java
...book/copyright/service/impl/BookAuthServeServiceImpl.java
+10
-0
BookAuthInfoAndServesVO.java
...com/pcloud/book/copyright/vo/BookAuthInfoAndServesVO.java
+11
-0
BookAuthInfoVO.java
...ain/java/com/pcloud/book/copyright/vo/BookAuthInfoVO.java
+4
-95
SetAuthOpenParam.java
...n/java/com/pcloud/book/copyright/vo/SetAuthOpenParam.java
+5
-104
SetAuthStatusParam.java
...java/com/pcloud/book/copyright/vo/SetAuthStatusParam.java
+11
-0
BookAuthInfo.Mapper.xml
...c/main/resources/mapper/copyright/BookAuthInfo.Mapper.xml
+18
-5
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/book/dto/BookInfoAndAuthStatusDTO.java
View file @
05f160be
...
@@ -3,6 +3,7 @@ package com.pcloud.book.book.dto;
...
@@ -3,6 +3,7 @@ package com.pcloud.book.book.dto;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -10,6 +11,7 @@ import java.io.Serializable;
...
@@ -10,6 +11,7 @@ import java.io.Serializable;
* @author lily
* @author lily
* @date 2018/12/5 20:51
* @date 2018/12/5 20:51
*/
*/
@Data
@ApiModel
@ApiModel
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
BookInfoAndAuthStatusDTO
implements
Serializable
{
public
class
BookInfoAndAuthStatusDTO
implements
Serializable
{
...
@@ -35,71 +37,6 @@ public class BookInfoAndAuthStatusDTO implements Serializable {
...
@@ -35,71 +37,6 @@ public class BookInfoAndAuthStatusDTO implements Serializable {
@ApiModelProperty
(
"书刊作者"
)
@ApiModelProperty
(
"书刊作者"
)
private
String
author
;
private
String
author
;
public
Integer
getIsDelete
()
{
@ApiModelProperty
(
"授权后还需付费"
)
return
isDelete
;
private
Integer
isAuthorizedPay
;
}
public
void
setIsDelete
(
Integer
isDelete
)
{
this
.
isDelete
=
isDelete
;
}
public
Long
getBookId
()
{
return
bookId
;
}
public
void
setBookId
(
Long
bookId
)
{
this
.
bookId
=
bookId
;
}
public
String
getBookName
()
{
return
bookName
;
}
public
void
setBookName
(
String
bookName
)
{
this
.
bookName
=
bookName
;
}
public
String
getCoverImg
()
{
return
coverImg
;
}
public
void
setCoverImg
(
String
coverImg
)
{
this
.
coverImg
=
coverImg
;
}
public
Integer
getBookStatus
()
{
return
bookStatus
;
}
public
void
setBookStatus
(
Integer
bookStatus
)
{
this
.
bookStatus
=
bookStatus
;
}
public
String
getPublish
()
{
return
publish
;
}
public
void
setPublish
(
String
publish
)
{
this
.
publish
=
publish
;
}
public
String
getAuthor
()
{
return
author
;
}
public
void
setAuthor
(
String
author
)
{
this
.
author
=
author
;
}
@Override
public
String
toString
()
{
return
"BookInfoAndAuthStatusDTO{"
+
"bookId="
+
bookId
+
", bookName='"
+
bookName
+
'\''
+
", coverImg='"
+
coverImg
+
'\''
+
", bookStatus="
+
bookStatus
+
", publish='"
+
publish
+
'\''
+
", isDelete="
+
isDelete
+
'}'
;
}
}
}
pcloud-facade-book/src/main/java/com/pcloud/book/copyright/service/BookAuthServeService.java
View file @
05f160be
...
@@ -40,4 +40,9 @@ public interface BookAuthServeService {
...
@@ -40,4 +40,9 @@ public interface BookAuthServeService {
ResponseEntity
<
ResponseDto
<
Map
<
String
,
Boolean
>>>
listIsOpen4ServeIdsAndBookId
(
@RequestBody
BookAuthServerDTO
bookAuthServerDTO
)
ResponseEntity
<
ResponseDto
<
Map
<
String
,
Boolean
>>>
listIsOpen4ServeIdsAndBookId
(
@RequestBody
BookAuthServerDTO
bookAuthServerDTO
)
throws
BizException
;
throws
BizException
;
@ApiOperation
(
value
=
"获取应用是否开启授权后仍需付费"
,
httpMethod
=
"POST"
)
@PostMapping
(
"listIsOpen4AuthorizedFree"
)
ResponseEntity
<
ResponseDto
<
Map
<
String
,
Boolean
>>>
listIsOpen4AuthorizedPay
(
@RequestBody
BookAuthServerDTO
bookAuthServerDTO
)
throws
BizException
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/copyright/biz/BookAuthInfoBiz.java
View file @
05f160be
...
@@ -28,6 +28,11 @@ public interface BookAuthInfoBiz {
...
@@ -28,6 +28,11 @@ public interface BookAuthInfoBiz {
void
setBookAuthOpen
(
SetAuthOpenParam
setAuthOpenParam
,
Long
adviserId
);
void
setBookAuthOpen
(
SetAuthOpenParam
setAuthOpenParam
,
Long
adviserId
);
/**
/**
* 设置授权后付费查看
*/
void
setBookAuthPay
(
SetAuthStatusParam
setAuthStatusParam
,
Long
adviserId
);
/**
* 设置图书版权状态
* 设置图书版权状态
*/
*/
void
setAuthStatus
(
SetAuthStatusParam
setAuthStatusParam
,
Long
adviserId
);
void
setAuthStatus
(
SetAuthStatusParam
setAuthStatusParam
,
Long
adviserId
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/copyright/biz/BookAuthServeBiz.java
View file @
05f160be
...
@@ -23,6 +23,12 @@ public interface BookAuthServeBiz {
...
@@ -23,6 +23,12 @@ public interface BookAuthServeBiz {
Map
<
String
,
Boolean
>
isSetServeAuth
(
Long
bookId
,
Long
channelId
,
Long
adviserId
,
List
<
Long
>
serveIds
)
;
Map
<
String
,
Boolean
>
isSetServeAuth
(
Long
bookId
,
Long
channelId
,
Long
adviserId
,
List
<
Long
>
serveIds
)
;
/**
/**
* 服务是否开启版权保护,以及授权后仍付费
* @return
*/
Map
<
String
,
Boolean
>
isSetServeAuthPay
(
Long
bookId
,
Long
channelId
,
Long
adviserId
,
List
<
Long
>
serveIds
)
;
/**
* 获取图书配置得服务
* 获取图书配置得服务
* @return
* @return
*/
*/
...
@@ -44,4 +50,9 @@ public interface BookAuthServeBiz {
...
@@ -44,4 +50,9 @@ public interface BookAuthServeBiz {
* 获取图书是否开启版权保护
* 获取图书是否开启版权保护
*/
*/
Map
<
String
,
Boolean
>
listIsOpen4ServeIdsAndBookId
(
Long
bookId
,
Long
adviserId
,
Long
channelId
,
List
<
Long
>
serveIds
);
Map
<
String
,
Boolean
>
listIsOpen4ServeIdsAndBookId
(
Long
bookId
,
Long
adviserId
,
Long
channelId
,
List
<
Long
>
serveIds
);
/**
* 获取图书是否开启授权后仍需付费
*/
Map
<
String
,
Boolean
>
listIsOpen4AuthorizedPay
(
Long
bookId
,
Long
adviserId
,
Long
channelId
,
List
<
Long
>
serveIds
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/copyright/biz/impl/BookAuthInfoBizImpl.java
View file @
05f160be
...
@@ -362,6 +362,28 @@ public class BookAuthInfoBizImpl implements BookAuthInfoBiz {
...
@@ -362,6 +362,28 @@ public class BookAuthInfoBizImpl implements BookAuthInfoBiz {
// return zipUrlInfo != null ? zipUrlInfo.getUrl() : null;
// return zipUrlInfo != null ? zipUrlInfo.getUrl() : null;
// }
// }
@Override
@ParamLog
(
"设置授权后付费查看"
)
public
void
setBookAuthPay
(
SetAuthStatusParam
setAuthStatusParam
,
Long
adviserId
)
{
Long
bookId
=
setAuthStatusParam
.
getBookId
();
Long
channelId
=
setAuthStatusParam
.
getChannelId
();
Integer
isAuthorizedPay
=
setAuthStatusParam
.
getIsAuthorizedPay
();
Integer
authBookType
=
setAuthStatusParam
.
getAuthBookType
();
if
(
bookId
==
null
||
channelId
==
null
||
adviserId
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"图书不存在"
);
}
BookAuthInfoVO
bookAuthInfo
=
bookAuthInfoDao
.
getInfoByBook
(
bookId
,
channelId
,
adviserId
,
authBookType
);
if
(
bookAuthInfo
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"图书未开启版权保护"
);
}
bookAuthInfo
.
setIsAuthorizedPay
(
isAuthorizedPay
);
bookAuthInfoDao
.
updateAuthorizedPay
(
bookAuthInfo
.
getId
(),
isAuthorizedPay
,
adviserId
);
if
(
authBookType
==
null
)
{
authBookType
=
0
;
}
String
key
=
CopyrightConstants
.
BOOK_AUTH_INFO
+
bookAuthInfo
.
getBookId
()
+
"-"
+
bookAuthInfo
.
getChannelId
()
+
"-"
+
adviserId
+
"-"
+
authBookType
;
JedisClusterUtils
.
setJson
(
key
,
bookAuthInfo
);
}
@Override
@Override
@ParamLog
(
"设置版权保护状态"
)
@ParamLog
(
"设置版权保护状态"
)
...
...
pcloud-service-book/src/main/java/com/pcloud/book/copyright/biz/impl/BookAuthServeBizImpl.java
View file @
05f160be
package
com
.
pcloud
.
book
.
copyright
.
biz
.
impl
;
package
com
.
pcloud
.
book
.
copyright
.
biz
.
impl
;
import
cn.hutool.core.collection.CollUtil
;
import
com.pcloud.book.base.enums.BookStatusEnum
;
import
com.pcloud.book.base.enums.BookStatusEnum
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.book.biz.BookBiz
;
import
com.pcloud.book.book.biz.BookBiz
;
import
com.pcloud.book.book.dto.BookInfoAndAuthStatusDTO
;
import
com.pcloud.book.book.dto.BookInfoAndAuthStatusDTO
;
import
com.pcloud.book.consumer.app.AppConsr
;
import
com.pcloud.book.consumer.channel.QrcodeSceneConsr
;
import
com.pcloud.book.consumer.channel.QrcodeSceneConsr
;
import
com.pcloud.book.consumer.resource.ProductConsr
;
import
com.pcloud.book.copyright.biz.BookAuthServeBiz
;
import
com.pcloud.book.copyright.biz.BookAuthServeBiz
;
import
com.pcloud.book.copyright.dao.BookAuthServeDao
;
import
com.pcloud.book.copyright.dao.BookAuthServeDao
;
import
com.pcloud.book.copyright.dto.ServeDTO
;
import
com.pcloud.book.copyright.dto.ServeDTO
;
...
@@ -14,6 +17,8 @@ import com.pcloud.channelcenter.qrcode.dto.QrcodeSceneDto;
...
@@ -14,6 +17,8 @@ import com.pcloud.channelcenter.qrcode.dto.QrcodeSceneDto;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.message.common.enums.YesNoEnums
;
import
com.pcloud.resourcecenter.product.dto.ProductDto
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
...
@@ -35,6 +40,10 @@ public class BookAuthServeBizImpl implements BookAuthServeBiz {
...
@@ -35,6 +40,10 @@ public class BookAuthServeBizImpl implements BookAuthServeBiz {
private
QrcodeSceneConsr
qrcodeSceneConsr
;
private
QrcodeSceneConsr
qrcodeSceneConsr
;
@Autowired
@Autowired
private
BookBiz
bookBiz
;
private
BookBiz
bookBiz
;
@Autowired
private
AppConsr
appConsr
;
@Autowired
private
ProductConsr
productConsr
;
@Override
@Override
@ParamLog
(
"设置图书授权服务"
)
@ParamLog
(
"设置图书授权服务"
)
...
@@ -70,6 +79,36 @@ public class BookAuthServeBizImpl implements BookAuthServeBiz {
...
@@ -70,6 +79,36 @@ public class BookAuthServeBizImpl implements BookAuthServeBiz {
}
}
@Override
@Override
@ParamLog
(
"服务是否开启版权保护,以及授权后仍付费"
)
public
Map
<
String
,
Boolean
>
isSetServeAuthPay
(
Long
bookId
,
Long
channelId
,
Long
adviserId
,
List
<
Long
>
serveIds
)
{
if
(
bookId
==
null
||
channelId
==
null
||
adviserId
==
null
||
ListUtils
.
isEmpty
(
serveIds
))
{
return
null
;
}
List
<
ServeDTO
>
serveDTOS
=
bookAuthServeDao
.
isSetServeAuth
(
bookId
,
channelId
,
adviserId
,
serveIds
);
if
(
ListUtils
.
isEmpty
(
serveDTOS
))
{
return
null
;
}
Map
<
String
,
Boolean
>
isSetServesMap
=
new
HashMap
<>();
List
<
Long
>
productIds
=
CollUtil
.
toList
();
for
(
ServeDTO
serveDTO
:
serveDTOS
)
{
if
(
serveDTO
.
getServeType
().
equalsIgnoreCase
(
"product"
)){
productIds
.
add
(
serveDTO
.
getServeId
());
}
}
// TAPD:1005196 目前只支持视频、题库等作品
List
<
String
>
openAuthPayProductTypeCodeList
=
CollUtil
.
toList
(
"VIDEO"
,
"PRETEST"
);
Map
<
Long
,
ProductDto
>
productMap
=
productConsr
.
getProBasesByIds
(
productIds
);
if
(
CollUtil
.
isNotEmpty
(
productMap
)){
for
(
ProductDto
productDto
:
productMap
.
values
())
{
if
(
productDto
.
getProductTypeDto
()
!=
null
&&
openAuthPayProductTypeCodeList
.
contains
(
productDto
.
getProductTypeDto
().
getTypeCode
())){
isSetServesMap
.
put
(
"PRODUCT"
+
productDto
.
getProductId
(),
true
);
}
}
}
return
isSetServesMap
;
}
@Override
public
List
<
ServeVO
>
listServesByBook
(
Long
bookId
,
Long
channelId
,
Long
adviserId
)
{
public
List
<
ServeVO
>
listServesByBook
(
Long
bookId
,
Long
channelId
,
Long
adviserId
)
{
return
bookAuthServeDao
.
listServesByBook
(
bookId
,
channelId
,
adviserId
);
return
bookAuthServeDao
.
listServesByBook
(
bookId
,
channelId
,
adviserId
);
}
}
...
@@ -132,4 +171,15 @@ public class BookAuthServeBizImpl implements BookAuthServeBiz {
...
@@ -132,4 +171,15 @@ public class BookAuthServeBizImpl implements BookAuthServeBiz {
bookAuthServeDao
.
deleteServes
(
ids
);
bookAuthServeDao
.
deleteServes
(
ids
);
}
}
@Override
public
Map
<
String
,
Boolean
>
listIsOpen4AuthorizedPay
(
Long
bookId
,
Long
adviserId
,
Long
channelId
,
List
<
Long
>
serveIds
)
{
BookInfoAndAuthStatusDTO
baseAndAuthStatus
=
bookBiz
.
getBaseAndAuthStatus
(
bookId
,
channelId
,
adviserId
);
final
boolean
boo
=
baseAndAuthStatus
!=
null
&&
BookStatusEnum
.
PROTECT
.
value
.
equals
(
baseAndAuthStatus
.
getBookStatus
())
&&
BookStatusEnum
.
BookDeleteStatus
.
NOT_DELETE
.
value
.
equals
(
baseAndAuthStatus
.
getIsDelete
())
&&
YesNoEnums
.
YES
.
code
.
equals
(
baseAndAuthStatus
.
getIsAuthorizedPay
());
if
(
boo
)
{
return
isSetServeAuthPay
(
bookId
,
channelId
,
adviserId
,
serveIds
);
}
return
null
;
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/copyright/biz/impl/BookAuthUserBizImpl.java
View file @
05f160be
package
com
.
pcloud
.
book
.
copyright
.
biz
.
impl
;
package
com
.
pcloud
.
book
.
copyright
.
biz
.
impl
;
import
cn.hutool.core.collection.CollUtil
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.base.exception.BookBizException
;
...
@@ -7,6 +8,7 @@ import com.pcloud.book.consumer.channel.QrcodeSceneConsr;
...
@@ -7,6 +8,7 @@ import com.pcloud.book.consumer.channel.QrcodeSceneConsr;
import
com.pcloud.book.consumer.live.LiveCons
;
import
com.pcloud.book.consumer.live.LiveCons
;
import
com.pcloud.book.consumer.reader.ReaderConsr
;
import
com.pcloud.book.consumer.reader.ReaderConsr
;
import
com.pcloud.book.consumer.resource.ProductConsr
;
import
com.pcloud.book.consumer.resource.ProductConsr
;
import
com.pcloud.book.copyright.biz.BookAuthServeBiz
;
import
com.pcloud.book.copyright.biz.BookAuthUserBiz
;
import
com.pcloud.book.copyright.biz.BookAuthUserBiz
;
import
com.pcloud.book.copyright.dao.BookAuthServeDao
;
import
com.pcloud.book.copyright.dao.BookAuthServeDao
;
import
com.pcloud.book.copyright.dao.BookAuthUserDao
;
import
com.pcloud.book.copyright.dao.BookAuthUserDao
;
...
@@ -70,6 +72,8 @@ public class BookAuthUserBizImpl implements BookAuthUserBiz {
...
@@ -70,6 +72,8 @@ public class BookAuthUserBizImpl implements BookAuthUserBiz {
private
ProductConsr
productConsr
;
private
ProductConsr
productConsr
;
@Autowired
@Autowired
private
ReaderConsr
readerConsr
;
private
ReaderConsr
readerConsr
;
@Autowired
private
BookAuthServeBiz
bookAuthServeBiz
;
@ParamLog
(
value
=
"获取授权用户数量"
)
@ParamLog
(
value
=
"获取授权用户数量"
)
...
@@ -217,13 +221,23 @@ public class BookAuthUserBizImpl implements BookAuthUserBiz {
...
@@ -217,13 +221,23 @@ public class BookAuthUserBizImpl implements BookAuthUserBiz {
List
<
Long
>
serverIds
=
new
ArrayList
<>();
List
<
Long
>
serverIds
=
new
ArrayList
<>();
serverIds
.
add
(
serverId
);
serverIds
.
add
(
serverId
);
List
<
ServeDTO
>
serveDTOS
=
bookAuthServeDao
.
isSetServeAuth
(
bookId
,
channelId
,
adviserId
,
serverIds
);
List
<
ServeDTO
>
serveDTOS
=
bookAuthServeDao
.
isSetServeAuth
(
bookId
,
channelId
,
adviserId
,
serverIds
);
// 用户被授权, 且指定的应用也被版权保护时, 返回true
// 获取授权后是否仍需付费
return
!
ListUtils
.
isEmpty
(
serveDTOS
);
Boolean
isAuthorizedPay
=
checkIsAuthorizedPay
(
bookId
,
channelId
,
adviserId
,
serverId
);
// 用户被授权, 指定的应用也被版权保护,且授权后不需要付费,则返回true
return
!
ListUtils
.
isEmpty
(
serveDTOS
)
&&
!
isAuthorizedPay
;
}
}
// 其余情况都是false
// 其余情况都是false
return
false
;
return
false
;
}
}
private
Boolean
checkIsAuthorizedPay
(
Long
bookId
,
Long
channelId
,
Long
adviserId
,
Long
serverId
)
{
Map
<
String
,
Boolean
>
authorizedPayMap
=
bookAuthServeBiz
.
listIsOpen4AuthorizedPay
(
bookId
,
channelId
,
adviserId
,
CollUtil
.
toList
(
serverId
));
if
(
CollUtil
.
isEmpty
(
authorizedPayMap
)){
return
false
;
}
return
authorizedPayMap
.
getOrDefault
(
"PRODUCT"
+
serverId
,
false
);
}
// 判断是否为超级作者的商品
// 判断是否为超级作者的商品
private
Boolean
checkIsSuperProduct
(
Long
serverId
)
{
private
Boolean
checkIsSuperProduct
(
Long
serverId
)
{
Map
<
Long
,
Boolean
>
map
=
productConsr
.
getIsSuperByProductIdList
(
Lists
.
newArrayList
(
serverId
));
Map
<
Long
,
Boolean
>
map
=
productConsr
.
getIsSuperByProductIdList
(
Lists
.
newArrayList
(
serverId
));
...
...
pcloud-service-book/src/main/java/com/pcloud/book/copyright/dao/BookAuthInfoDao.java
View file @
05f160be
...
@@ -38,6 +38,11 @@ public interface BookAuthInfoDao extends BaseDao<BookAuthInfo> {
...
@@ -38,6 +38,11 @@ public interface BookAuthInfoDao extends BaseDao<BookAuthInfo> {
void
updateBookStatus
(
Long
id
,
Integer
bookStatus
,
Long
adviserId
);
void
updateBookStatus
(
Long
id
,
Integer
bookStatus
,
Long
adviserId
);
/**
/**
* 更新图书授权付费
*/
void
updateAuthorizedPay
(
Long
id
,
Integer
isAuthorizedPay
,
Long
adviserId
);
/**
* 更新图书版权基本信息
* 更新图书版权基本信息
*/
*/
void
updateBaseInfo
(
BookAuthInfo
bookAuthInfo
);
void
updateBaseInfo
(
BookAuthInfo
bookAuthInfo
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/copyright/dao/impl/BookAuthInfoDaoImpl.java
View file @
05f160be
...
@@ -66,6 +66,15 @@ public class BookAuthInfoDaoImpl extends BaseDaoImpl<BookAuthInfo> implements Bo
...
@@ -66,6 +66,15 @@ public class BookAuthInfoDaoImpl extends BaseDaoImpl<BookAuthInfo> implements Bo
}
}
@Override
@Override
public
void
updateAuthorizedPay
(
Long
id
,
Integer
isAuthorizedPay
,
Long
adviserId
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"id"
,
id
);
paramMap
.
put
(
"isAuthorizedPay"
,
isAuthorizedPay
);
paramMap
.
put
(
"adviserId"
,
adviserId
);
this
.
getSqlSession
().
update
(
this
.
getStatement
(
"updateAuthorizedPay"
),
paramMap
);
}
@Override
public
void
updateBaseInfo
(
BookAuthInfo
bookAuthInfo
)
{
public
void
updateBaseInfo
(
BookAuthInfo
bookAuthInfo
)
{
this
.
getSqlSession
().
update
(
this
.
getStatement
(
"updateBaseInfo"
),
bookAuthInfo
);
this
.
getSqlSession
().
update
(
this
.
getStatement
(
"updateBaseInfo"
),
bookAuthInfo
);
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/copyright/entity/BookAuthInfo.java
View file @
05f160be
...
@@ -3,6 +3,7 @@ package com.pcloud.book.copyright.entity;
...
@@ -3,6 +3,7 @@ package com.pcloud.book.copyright.entity;
import
com.pcloud.common.entity.BaseEntity
;
import
com.pcloud.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -11,6 +12,7 @@ import java.util.Date;
...
@@ -11,6 +12,7 @@ import java.util.Date;
* @author lily
* @author lily
* @date 2018/12/3 11:14
* @date 2018/12/3 11:14
*/
*/
@Data
@ApiModel
@ApiModel
public
class
BookAuthInfo
extends
BaseEntity
{
public
class
BookAuthInfo
extends
BaseEntity
{
@ApiModelProperty
(
"图书授权信息标识"
)
@ApiModelProperty
(
"图书授权信息标识"
)
...
@@ -67,173 +69,7 @@ public class BookAuthInfo extends BaseEntity {
...
@@ -67,173 +69,7 @@ public class BookAuthInfo extends BaseEntity {
@ApiModelProperty
(
"是否是社群书"
)
@ApiModelProperty
(
"是否是社群书"
)
private
Integer
isGroupBook
;
private
Integer
isGroupBook
;
@Override
@ApiModelProperty
(
"授权后仍需付费"
)
public
Long
getId
()
{
private
Integer
isAuthorizedPay
;
return
id
;
}
@Override
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
Long
getBookId
()
{
return
bookId
;
}
public
void
setBookId
(
Long
bookId
)
{
this
.
bookId
=
bookId
;
}
public
Long
getChannelId
()
{
return
channelId
;
}
public
void
setChannelId
(
Long
channelId
)
{
this
.
channelId
=
channelId
;
}
public
Long
getAdviserId
()
{
return
adviserId
;
}
public
void
setAdviserId
(
Long
adviserId
)
{
this
.
adviserId
=
adviserId
;
}
public
BigDecimal
getPrice
()
{
return
price
;
}
public
void
setPrice
(
BigDecimal
price
)
{
this
.
price
=
price
;
}
public
Integer
getCodeUseCount
()
{
return
codeUseCount
;
}
public
void
setCodeUseCount
(
Integer
codeUseCount
)
{
this
.
codeUseCount
=
codeUseCount
;
}
public
String
getBuyUrl
()
{
return
buyUrl
;
}
public
void
setBuyUrl
(
String
buyUrl
)
{
this
.
buyUrl
=
buyUrl
;
}
public
Integer
getBookStatus
()
{
return
bookStatus
;
}
public
void
setBookStatus
(
Integer
bookStatus
)
{
this
.
bookStatus
=
bookStatus
;
}
public
String
getLocationDesc
()
{
return
locationDesc
;
}
public
void
setLocationDesc
(
String
locationDesc
)
{
this
.
locationDesc
=
locationDesc
;
}
public
Long
getCreatedUser
()
{
return
createdUser
;
}
public
void
setCreatedUser
(
Long
createdUser
)
{
this
.
createdUser
=
createdUser
;
}
public
Date
getCreatedDate
()
{
return
createdDate
;
}
public
void
setCreatedDate
(
Date
createdDate
)
{
this
.
createdDate
=
createdDate
;
}
public
Long
getLastModifiedUser
()
{
return
lastModifiedUser
;
}
public
void
setLastModifiedUser
(
Long
lastModifiedUser
)
{
this
.
lastModifiedUser
=
lastModifiedUser
;
}
public
Date
getLastModifiedDate
()
{
return
lastModifiedDate
;
}
public
void
setLastModifiedDate
(
Date
lastModifiedDate
)
{
this
.
lastModifiedDate
=
lastModifiedDate
;
}
public
Integer
getCheckType
()
{
return
checkType
;
}
public
void
setCheckType
(
Integer
checkType
)
{
this
.
checkType
=
checkType
;
}
public
Date
getOpenTime
()
{
return
openTime
;
}
public
void
setOpenTime
(
Date
openTime
)
{
this
.
openTime
=
openTime
;
}
public
Date
getCloseTime
()
{
return
closeTime
;
}
public
void
setCloseTime
(
Date
closeTime
)
{
this
.
closeTime
=
closeTime
;
}
public
Integer
getIsPaperBook
()
{
return
isPaperBook
;
}
public
void
setIsPaperBook
(
Integer
isPaperBook
)
{
this
.
isPaperBook
=
isPaperBook
;
}
public
Integer
getIsGroupBook
()
{
return
isGroupBook
;
}
public
void
setIsGroupBook
(
Integer
isGroupBook
)
{
this
.
isGroupBook
=
isGroupBook
;
}
@Override
public
String
toString
()
{
return
"BookAuthInfo{"
+
"id="
+
id
+
", bookId="
+
bookId
+
", channelId="
+
channelId
+
", adviserId="
+
adviserId
+
", price="
+
price
+
", codeUseCount="
+
codeUseCount
+
", buyUrl='"
+
buyUrl
+
'\''
+
", bookStatus="
+
bookStatus
+
", locationDesc='"
+
locationDesc
+
'\''
+
", checkType="
+
checkType
+
", createdUser="
+
createdUser
+
", createdDate="
+
createdDate
+
", lastModifiedUser="
+
lastModifiedUser
+
", lastModifiedDate="
+
lastModifiedDate
+
", openTime="
+
openTime
+
", closeTime="
+
closeTime
+
", isPaperBook="
+
isPaperBook
+
", isGroupBook="
+
isGroupBook
+
'}'
;
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/copyright/facade/impl/BookAuthInfoFacadeImpl.java
View file @
05f160be
...
@@ -17,6 +17,7 @@ import com.pcloud.common.page.PageBeanNew;
...
@@ -17,6 +17,7 @@ import com.pcloud.common.page.PageBeanNew;
import
com.pcloud.common.permission.PermissionException
;
import
com.pcloud.common.permission.PermissionException
;
import
com.pcloud.common.utils.SessionUtil
;
import
com.pcloud.common.utils.SessionUtil
;
import
com.pcloud.common.utils.cookie.Cookie
;
import
com.pcloud.common.utils.cookie.Cookie
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.CookieValue
;
import
org.springframework.web.bind.annotation.CookieValue
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
@@ -47,6 +48,14 @@ public class BookAuthInfoFacadeImpl implements BookAuthInfoFacade {
...
@@ -47,6 +48,14 @@ public class BookAuthInfoFacadeImpl implements BookAuthInfoFacade {
return
new
ResponseDto
<>();
return
new
ResponseDto
<>();
}
}
@ApiOperation
(
"设置授权后付费查看"
)
@PostMapping
(
"setBookAuthPay"
)
public
ResponseDto
<?>
setBookAuthPay
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
SetAuthStatusParam
setAuthStatusParam
)
throws
PermissionException
,
BizException
{
Long
adviserId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
bookAuthInfoBiz
.
setBookAuthPay
(
setAuthStatusParam
,
adviserId
);
return
new
ResponseDto
<>();
}
@Override
@Override
@PostMapping
(
"setAuthStatus"
)
@PostMapping
(
"setAuthStatus"
)
public
ResponseDto
<?>
setAuthStatus
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
SetAuthStatusParam
setAuthStatusParam
)
throws
PermissionException
,
BizException
{
public
ResponseDto
<?>
setAuthStatus
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
SetAuthStatusParam
setAuthStatusParam
)
throws
PermissionException
,
BizException
{
...
...
pcloud-service-book/src/main/java/com/pcloud/book/copyright/service/impl/BookAuthServeServiceImpl.java
View file @
05f160be
...
@@ -58,4 +58,14 @@ public class BookAuthServeServiceImpl implements BookAuthServeService {
...
@@ -58,4 +58,14 @@ public class BookAuthServeServiceImpl implements BookAuthServeService {
}
}
return
ResponseHandleUtil
.
toResponse
(
isOpen4ServeIds
);
return
ResponseHandleUtil
.
toResponse
(
isOpen4ServeIds
);
}
}
@Override
@PostMapping
(
"listIsOpen4AuthorizedPay"
)
public
ResponseEntity
<
ResponseDto
<
Map
<
String
,
Boolean
>>>
listIsOpen4AuthorizedPay
(
@RequestBody
BookAuthServerDTO
bookAuthServerDTO
)
throws
BizException
{
Map
<
String
,
Boolean
>
isOpen4ServeIds
=
null
;
if
(
bookAuthServerDTO
!=
null
&&
!
bookAuthServerDTO
.
check
())
{
isOpen4ServeIds
=
bookAuthServeBiz
.
listIsOpen4AuthorizedPay
(
bookAuthServerDTO
.
getBookId
(),
bookAuthServerDTO
.
getAdviserId
(),
bookAuthServerDTO
.
getChannelId
(),
bookAuthServerDTO
.
getServeIds
());
}
return
ResponseHandleUtil
.
toResponse
(
isOpen4ServeIds
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/copyright/vo/BookAuthInfoAndServesVO.java
View file @
05f160be
...
@@ -52,6 +52,9 @@ public class BookAuthInfoAndServesVO implements Serializable {
...
@@ -52,6 +52,9 @@ public class BookAuthInfoAndServesVO implements Serializable {
@ApiModelProperty
(
"是否有使用过的授权码"
)
@ApiModelProperty
(
"是否有使用过的授权码"
)
private
Boolean
haveUsedAuthCode
;
private
Boolean
haveUsedAuthCode
;
@ApiModelProperty
(
"授权后仍需付费"
)
private
Integer
isAuthorizedPay
;
public
Long
getId
()
{
public
Long
getId
()
{
return
id
;
return
id
;
...
@@ -149,6 +152,14 @@ public class BookAuthInfoAndServesVO implements Serializable {
...
@@ -149,6 +152,14 @@ public class BookAuthInfoAndServesVO implements Serializable {
this
.
haveUsedAuthCode
=
haveUsedAuthCode
;
this
.
haveUsedAuthCode
=
haveUsedAuthCode
;
}
}
public
Integer
getIsAuthorizedPay
()
{
return
isAuthorizedPay
;
}
public
void
setIsAuthorizedPay
(
Integer
isAuthorizedPay
)
{
this
.
isAuthorizedPay
=
isAuthorizedPay
;
}
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
"BookAuthInfoAndServesVO{"
+
return
"BookAuthInfoAndServesVO{"
+
...
...
pcloud-service-book/src/main/java/com/pcloud/book/copyright/vo/BookAuthInfoVO.java
View file @
05f160be
...
@@ -3,6 +3,7 @@ package com.pcloud.book.copyright.vo;
...
@@ -3,6 +3,7 @@ package com.pcloud.book.copyright.vo;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
...
@@ -11,6 +12,7 @@ import java.math.BigDecimal;
...
@@ -11,6 +12,7 @@ import java.math.BigDecimal;
* @author lily
* @author lily
* @date 2018/12/4 11:50
* @date 2018/12/4 11:50
*/
*/
@Data
@ApiModel
@ApiModel
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
BookAuthInfoVO
implements
Serializable
{
public
class
BookAuthInfoVO
implements
Serializable
{
...
@@ -45,100 +47,7 @@ public class BookAuthInfoVO implements Serializable {
...
@@ -45,100 +47,7 @@ public class BookAuthInfoVO implements Serializable {
@ApiModelProperty
(
"位置描述"
)
@ApiModelProperty
(
"位置描述"
)
private
String
locationDesc
;
private
String
locationDesc
;
@ApiModelProperty
(
"授权后仍需付费"
)
private
Integer
isAuthorizedPay
;
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
Long
getBookId
()
{
return
bookId
;
}
public
void
setBookId
(
Long
bookId
)
{
this
.
bookId
=
bookId
;
}
public
Long
getChannelId
()
{
return
channelId
;
}
public
void
setChannelId
(
Long
channelId
)
{
this
.
channelId
=
channelId
;
}
public
Long
getAdviserId
()
{
return
adviserId
;
}
public
void
setAdviserId
(
Long
adviserId
)
{
this
.
adviserId
=
adviserId
;
}
public
BigDecimal
getPrice
()
{
return
price
;
}
public
void
setPrice
(
BigDecimal
price
)
{
this
.
price
=
price
;
}
public
Integer
getCodeUseCount
()
{
return
codeUseCount
;
}
public
void
setCodeUseCount
(
Integer
codeUseCount
)
{
this
.
codeUseCount
=
codeUseCount
;
}
public
String
getBuyUrl
()
{
return
buyUrl
;
}
public
void
setBuyUrl
(
String
buyUrl
)
{
this
.
buyUrl
=
buyUrl
;
}
public
Integer
getBookStatus
()
{
return
bookStatus
;
}
public
void
setBookStatus
(
Integer
bookStatus
)
{
this
.
bookStatus
=
bookStatus
;
}
public
Integer
getCheckType
()
{
return
checkType
;
}
public
void
setCheckType
(
Integer
checkType
)
{
this
.
checkType
=
checkType
;
}
public
String
getLocationDesc
()
{
return
locationDesc
;
}
public
void
setLocationDesc
(
String
locationDesc
)
{
this
.
locationDesc
=
locationDesc
;
}
@Override
public
String
toString
()
{
return
"BookAuthInfoVO{"
+
"id="
+
id
+
", bookId="
+
bookId
+
", channelId="
+
channelId
+
", adviserId="
+
adviserId
+
", price="
+
price
+
", codeUseCount="
+
codeUseCount
+
", buyUrl='"
+
buyUrl
+
'\''
+
", bookStatus="
+
bookStatus
+
", checkType="
+
checkType
+
", locationDesc='"
+
locationDesc
+
'\''
+
'}'
;
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/copyright/vo/SetAuthOpenParam.java
View file @
05f160be
...
@@ -3,6 +3,7 @@ package com.pcloud.book.copyright.vo;
...
@@ -3,6 +3,7 @@ package com.pcloud.book.copyright.vo;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
...
@@ -12,6 +13,7 @@ import java.util.List;
...
@@ -12,6 +13,7 @@ import java.util.List;
* @author lily
* @author lily
* @date 2018/12/3 11:26
* @date 2018/12/3 11:26
*/
*/
@Data
@ApiModel
@ApiModel
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
SetAuthOpenParam
implements
Serializable
{
public
class
SetAuthOpenParam
implements
Serializable
{
...
@@ -49,108 +51,7 @@ public class SetAuthOpenParam implements Serializable {
...
@@ -49,108 +51,7 @@ public class SetAuthOpenParam implements Serializable {
@ApiModelProperty
(
"书刊类型:0-现代纸书 1-社群书"
)
@ApiModelProperty
(
"书刊类型:0-现代纸书 1-社群书"
)
private
Integer
authBookType
;
private
Integer
authBookType
;
public
List
<
ServeVO
>
getServes
()
{
@ApiModelProperty
(
"授权后仍需付费"
)
return
serves
;
private
Integer
isAuthorizedPay
;
}
public
void
setServes
(
List
<
ServeVO
>
serves
)
{
this
.
serves
=
serves
;
}
public
Long
getBookId
()
{
return
bookId
;
}
public
void
setBookId
(
Long
bookId
)
{
this
.
bookId
=
bookId
;
}
public
Long
getChannelId
()
{
return
channelId
;
}
public
void
setChannelId
(
Long
channelId
)
{
this
.
channelId
=
channelId
;
}
public
Integer
getBookStatus
()
{
return
bookStatus
;
}
public
void
setBookStatus
(
Integer
bookStatus
)
{
this
.
bookStatus
=
bookStatus
;
}
public
BigDecimal
getPrice
()
{
return
price
;
}
public
void
setPrice
(
BigDecimal
price
)
{
this
.
price
=
price
;
}
public
Integer
getCodeUseCount
()
{
return
codeUseCount
;
}
public
void
setCodeUseCount
(
Integer
codeUseCount
)
{
this
.
codeUseCount
=
codeUseCount
;
}
public
Integer
getCodeCount
()
{
return
codeCount
;
}
public
void
setCodeCount
(
Integer
codeCount
)
{
this
.
codeCount
=
codeCount
;
}
public
String
getBuyUrl
()
{
return
buyUrl
;
}
public
void
setBuyUrl
(
String
buyUrl
)
{
this
.
buyUrl
=
buyUrl
;
}
public
Integer
getCheckType
()
{
return
checkType
;
}
public
void
setCheckType
(
Integer
checkType
)
{
this
.
checkType
=
checkType
;
}
public
Integer
getIsHaveBarCode
()
{
return
isHaveBarCode
;
}
public
void
setIsHaveBarCode
(
Integer
isHaveBarCode
)
{
this
.
isHaveBarCode
=
isHaveBarCode
;
}
public
Integer
getAuthBookType
()
{
return
authBookType
;
}
public
void
setAuthBookType
(
Integer
authBookType
)
{
this
.
authBookType
=
authBookType
;
}
@Override
public
String
toString
()
{
return
"SetAuthOpenParam{"
+
"bookId="
+
bookId
+
", channelId="
+
channelId
+
", price="
+
price
+
", codeUseCount="
+
codeUseCount
+
", codeCount="
+
codeCount
+
", buyUrl='"
+
buyUrl
+
'\''
+
", bookStatus="
+
bookStatus
+
", checkType="
+
checkType
+
", serves="
+
serves
+
", isHaveBarCode="
+
isHaveBarCode
+
", authBookType="
+
authBookType
+
'}'
;
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/copyright/vo/SetAuthStatusParam.java
View file @
05f160be
...
@@ -28,6 +28,9 @@ public class SetAuthStatusParam implements Serializable {
...
@@ -28,6 +28,9 @@ public class SetAuthStatusParam implements Serializable {
@ApiModelProperty
(
"书刊类型:0-现代纸书 1-社群书"
)
@ApiModelProperty
(
"书刊类型:0-现代纸书 1-社群书"
)
private
Integer
authBookType
;
private
Integer
authBookType
;
@ApiModelProperty
(
"授权后仍需付费"
)
private
Integer
isAuthorizedPay
;
public
Integer
getBookStatus
()
{
public
Integer
getBookStatus
()
{
return
bookStatus
;
return
bookStatus
;
}
}
...
@@ -60,6 +63,14 @@ public class SetAuthStatusParam implements Serializable {
...
@@ -60,6 +63,14 @@ public class SetAuthStatusParam implements Serializable {
this
.
authBookType
=
authBookType
;
this
.
authBookType
=
authBookType
;
}
}
public
Integer
getIsAuthorizedPay
()
{
return
isAuthorizedPay
;
}
public
void
setIsAuthorizedPay
(
Integer
isAuthorizedPay
)
{
this
.
isAuthorizedPay
=
isAuthorizedPay
;
}
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
"SetAuthStatusParam{"
+
return
"SetAuthStatusParam{"
+
...
...
pcloud-service-book/src/main/resources/mapper/copyright/BookAuthInfo.Mapper.xml
View file @
05f160be
...
@@ -13,23 +13,24 @@
...
@@ -13,23 +13,24 @@
<result
column=
"LOCATION_DESC"
property=
"locationDesc"
jdbcType=
"VARCHAR"
/>
<result
column=
"LOCATION_DESC"
property=
"locationDesc"
jdbcType=
"VARCHAR"
/>
<result
column=
"BOOK_STATUS"
property=
"bookStatus"
jdbcType=
"TINYINT"
/>
<result
column=
"BOOK_STATUS"
property=
"bookStatus"
jdbcType=
"TINYINT"
/>
<result
column=
"check_type"
property=
"checkType"
jdbcType=
"TINYINT"
/>
<result
column=
"check_type"
property=
"checkType"
jdbcType=
"TINYINT"
/>
<result
column=
"is_authorized_pay"
property=
"isAuthorizedPay"
jdbcType=
"TINYINT"
/>
</resultMap>
</resultMap>
<insert
id=
"insert"
useGeneratedKeys=
"true"
parameterType=
"bookAuthInfo"
>
<insert
id=
"insert"
useGeneratedKeys=
"true"
parameterType=
"bookAuthInfo"
>
INSERT INTO BOOK_AUTH_INFO(
INSERT INTO BOOK_AUTH_INFO(
BOOK_ID, CHANNEL_ID,ADVISER_ID,PRICE,CODE_USE_COUNT,BUY_URL,CHECK_TYPE, CREATED_USER, CREATED_DATE,LAST_MODIFIED_DATE,OPEN_TIME,
BOOK_ID, CHANNEL_ID,ADVISER_ID,PRICE,CODE_USE_COUNT,BUY_URL,CHECK_TYPE, CREATED_USER, CREATED_DATE,LAST_MODIFIED_DATE,OPEN_TIME,
is_paper_book, is_group_book
is_paper_book, is_group_book
, is_authorized_pay
)
)
VALUES
VALUES
(#{bookId,jdbcType=BIGINT}, #{channelId,jdbcType=BIGINT}, #{adviserId,jdbcType=BIGINT},
(#{bookId,jdbcType=BIGINT}, #{channelId,jdbcType=BIGINT}, #{adviserId,jdbcType=BIGINT},
#{price}, #{codeUseCount,jdbcType=BIGINT}, #{buyUrl}, #{checkType},
#{price}, #{codeUseCount,jdbcType=BIGINT}, #{buyUrl}, #{checkType},
#{adviserId,jdbcType=BIGINT}, NOW(), NOW(), NOW(),
#{adviserId,jdbcType=BIGINT}, NOW(), NOW(), NOW(),
#{isPaperBook}, #{isGroupBook})
#{isPaperBook}, #{isGroupBook}
, IFNULL(#{isAuthorizedPay},0)
)
</insert>
</insert>
<select
id=
"getInfoByBook"
resultMap=
"BookAuthInfoMap"
parameterType=
"map"
>
<select
id=
"getInfoByBook"
resultMap=
"BookAuthInfoMap"
parameterType=
"map"
>
SELECT
SELECT
ID, BOOK_ID, CHANNEL_ID,ADVISER_ID,PRICE,CODE_USE_COUNT,BUY_URL,CHECK_TYPE,BOOK_STATUS,LOCATION_DESC
ID, BOOK_ID, CHANNEL_ID,ADVISER_ID,PRICE,CODE_USE_COUNT,BUY_URL,CHECK_TYPE,BOOK_STATUS,LOCATION_DESC
, is_authorized_pay
FROM
FROM
BOOK_AUTH_INFO
BOOK_AUTH_INFO
WHERE
WHERE
...
@@ -215,6 +216,16 @@
...
@@ -215,6 +216,16 @@
ID = #{id}
ID = #{id}
</update>
</update>
<update
id=
"updateAuthorizedPay"
parameterType=
"map"
flushCache=
"true"
>
UPDATE BOOK_AUTH_INFO
SET
is_authorized_pay = #{isAuthorizedPay},
LAST_MODIFIED_DATE = NOW(),
LAST_MODIFIED_USER = #{adviserId}
WHERE
ID = #{id}
</update>
<update
id=
"updateLocationDesc"
parameterType=
"bookAuthInfo"
flushCache=
"true"
>
<update
id=
"updateLocationDesc"
parameterType=
"bookAuthInfo"
flushCache=
"true"
>
UPDATE BOOK_AUTH_INFO
UPDATE BOOK_AUTH_INFO
SET
SET
...
@@ -253,6 +264,9 @@
...
@@ -253,6 +264,9 @@
<if
test=
"lastModifiedUser != null"
>
<if
test=
"lastModifiedUser != null"
>
LAST_MODIFIED_USER = #{lastModifiedUser, jdbcType=BIGINT},
LAST_MODIFIED_USER = #{lastModifiedUser, jdbcType=BIGINT},
</if>
</if>
<if
test=
"isAuthorizedPay != null"
>
is_authorized_pay = #{isAuthorizedPay},
</if>
LAST_MODIFIED_DATE = NOW()
LAST_MODIFIED_DATE = NOW()
WHERE
WHERE
ID = #{id}
ID = #{id}
...
@@ -294,4 +308,4 @@
...
@@ -294,4 +308,4 @@
</if>
</if>
</select>
</select>
</mapper>
</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