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
9bf22f1b
Commit
9bf22f1b
authored
Aug 24, 2021
by
田超
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/1005183' into 'master'
feat: [1005183] 编辑端新增图书售卖服务 See merge request rays/pcloud-book!1387
parents
d2e34d79
80f0b581
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
483 additions
and
0 deletions
+483
-0
ResourcePageBookstoreBiz.java
...a/com/pcloud/book/group/biz/ResourcePageBookstoreBiz.java
+49
-0
ResourcePageBizImpl.java
...a/com/pcloud/book/group/biz/impl/ResourcePageBizImpl.java
+30
-0
ResourcePageBookstoreBizImpl.java
...oud/book/group/biz/impl/ResourcePageBookstoreBizImpl.java
+139
-0
ResourcePageBookstoreDao.java
...a/com/pcloud/book/group/dao/ResourcePageBookstoreDao.java
+20
-0
ResourcePageBookstoreDaoImpl.java
...oud/book/group/dao/impl/ResourcePageBookstoreDaoImpl.java
+29
-0
ResourcePageBookstore.java
...a/com/pcloud/book/group/entity/ResourcePageBookstore.java
+45
-0
ResourcePageBookstoreVO.java
...ava/com/pcloud/book/group/vo/ResourcePageBookstoreVO.java
+55
-0
ResourcePageVO.java
...rc/main/java/com/pcloud/book/group/vo/ResourcePageVO.java
+6
-0
UpdateResourcePageVO.java
...n/java/com/pcloud/book/group/vo/UpdateResourcePageVO.java
+4
-0
ResourcePageBookstore.Mapper.xml
...n/resources/mapper/group/ResourcePageBookstore.Mapper.xml
+106
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/ResourcePageBookstoreBiz.java
0 → 100644
View file @
9bf22f1b
package
com
.
pcloud
.
book
.
group
.
biz
;
import
com.pcloud.book.group.entity.ResourcePageBookstore
;
import
com.pcloud.book.group.vo.ResourcePageBookstoreVO
;
import
com.pcloud.common.page.PageBeanNew
;
import
java.util.List
;
/**
* 实体书购买(ResourcePageBookstore)表服务接口
*
* @author makejava
* @since 2021-08-16 14:40:27
*/
public
interface
ResourcePageBookstoreBiz
{
/**
* 通过ID查询单条数据
*/
ResourcePageBookstore
getById
(
Long
id
);
/**
* 分页查询
*/
PageBeanNew
getList
(
Integer
currentPage
,
Integer
numPerPage
);
/**
* 新增数据
*/
Long
insert
(
ResourcePageBookstore
resourcePageBookstore
);
/**
* 新增数据
*/
void
insert
(
List
<
ResourcePageBookstore
>
list
);
/**
* 修改数据
*/
void
update
(
ResourcePageBookstore
resourcePageBookstore
);
/**
* 通过主键删除数据
*/
void
deleteById
(
Long
id
);
void
deleteByResourcePageId
(
Long
resourcePageId
);
List
<
ResourcePageBookstoreVO
>
getByResourcePageId
(
Long
resourcePageId
,
Long
channelId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/ResourcePageBizImpl.java
View file @
9bf22f1b
...
@@ -36,6 +36,7 @@ import com.pcloud.book.consumer.wechatgroup.WechatGroupConsr;
...
@@ -36,6 +36,7 @@ import com.pcloud.book.consumer.wechatgroup.WechatGroupConsr;
import
com.pcloud.book.es.biz.ESBookAndAdviserBiz
;
import
com.pcloud.book.es.biz.ESBookAndAdviserBiz
;
import
com.pcloud.book.group.biz.BookGroupBiz
;
import
com.pcloud.book.group.biz.BookGroupBiz
;
import
com.pcloud.book.group.biz.ResourcePageBiz
;
import
com.pcloud.book.group.biz.ResourcePageBiz
;
import
com.pcloud.book.group.biz.ResourcePageBookstoreBiz
;
import
com.pcloud.book.group.constant.ResourcePageConstants
;
import
com.pcloud.book.group.constant.ResourcePageConstants
;
import
com.pcloud.book.group.dao.BookAppletSceneDao
;
import
com.pcloud.book.group.dao.BookAppletSceneDao
;
import
com.pcloud.book.group.dao.BookGroupDao
;
import
com.pcloud.book.group.dao.BookGroupDao
;
...
@@ -57,6 +58,7 @@ import com.pcloud.book.group.entity.BookAppletScene;
...
@@ -57,6 +58,7 @@ import com.pcloud.book.group.entity.BookAppletScene;
import
com.pcloud.book.group.entity.BookGroup
;
import
com.pcloud.book.group.entity.BookGroup
;
import
com.pcloud.book.group.entity.BookGroupServe
;
import
com.pcloud.book.group.entity.BookGroupServe
;
import
com.pcloud.book.group.entity.ResourcePage
;
import
com.pcloud.book.group.entity.ResourcePage
;
import
com.pcloud.book.group.entity.ResourcePageBookstore
;
import
com.pcloud.book.group.entity.ResourcePageCollect
;
import
com.pcloud.book.group.entity.ResourcePageCollect
;
import
com.pcloud.book.group.entity.ResourcePageColumn
;
import
com.pcloud.book.group.entity.ResourcePageColumn
;
import
com.pcloud.book.group.entity.ResourcePageCourse
;
import
com.pcloud.book.group.entity.ResourcePageCourse
;
...
@@ -65,6 +67,7 @@ import com.pcloud.book.group.entity.ResourcePageTool;
...
@@ -65,6 +67,7 @@ import com.pcloud.book.group.entity.ResourcePageTool;
import
com.pcloud.book.group.entity.ResourceRecomManage
;
import
com.pcloud.book.group.entity.ResourceRecomManage
;
import
com.pcloud.book.group.tools.SendWeixinRequestTools
;
import
com.pcloud.book.group.tools.SendWeixinRequestTools
;
import
com.pcloud.book.group.vo.ResourceColumnAndServeVO
;
import
com.pcloud.book.group.vo.ResourceColumnAndServeVO
;
import
com.pcloud.book.group.vo.ResourcePageBookstoreVO
;
import
com.pcloud.book.group.vo.ResourcePageItemVO
;
import
com.pcloud.book.group.vo.ResourcePageItemVO
;
import
com.pcloud.book.group.vo.ResourcePageOneServe
;
import
com.pcloud.book.group.vo.ResourcePageOneServe
;
import
com.pcloud.book.group.vo.ResourcePageVO
;
import
com.pcloud.book.group.vo.ResourcePageVO
;
...
@@ -202,6 +205,8 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
...
@@ -202,6 +205,8 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
private
AppletRecordAggrStatisBiz
appletRecordAggrStatisBiz
;
private
AppletRecordAggrStatisBiz
appletRecordAggrStatisBiz
;
@Autowired
@Autowired
private
ResourceRecomManageDao
resourceRecomManageDao
;
private
ResourceRecomManageDao
resourceRecomManageDao
;
@Autowired
private
ResourcePageBookstoreBiz
resourcePageBookstoreBiz
;
@Override
@Override
public
Long
updateResourcePage
(
UpdateResourcePageVO
updateResourcePageVO
)
{
public
Long
updateResourcePage
(
UpdateResourcePageVO
updateResourcePageVO
)
{
...
@@ -618,9 +623,22 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
...
@@ -618,9 +623,22 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
if
(!
MapUtils
.
isEmpty
(
agentMap
))
{
if
(!
MapUtils
.
isEmpty
(
agentMap
))
{
resourcePageVO
.
setAgentName
(
agentMap
.
get
(
adviserId
).
getAgentName
());
resourcePageVO
.
setAgentName
(
agentMap
.
get
(
adviserId
).
getAgentName
());
}
}
// 加载实体书购买
this
.
fillBookStore
(
resourcePageVO
);
return
resourcePageVO
;
return
resourcePageVO
;
}
}
/**
* 加载实体书购买
*/
private
void
fillBookStore
(
ResourcePageVO
resourcePageVO
)
{
if
(
resourcePageVO
==
null
||
resourcePageVO
.
getId
()
==
null
){
return
;
}
List
<
ResourcePageBookstoreVO
>
resourcePageBookstoreList
=
resourcePageBookstoreBiz
.
getByResourcePageId
(
resourcePageVO
.
getId
(),
resourcePageVO
.
getChannelId
());
resourcePageVO
.
setResourcePageBookstoreList
(
resourcePageBookstoreList
);
}
@Override
@Override
public
List
<
ResourceColumnAndServeVO
>
getColumnAndServeListByPageId
(
Long
resourcePageId
,
Boolean
isWechat
,
Long
bookId
,
Long
adviserId
,
Long
channelId
,
Integer
enableAdverting
)
{
public
List
<
ResourceColumnAndServeVO
>
getColumnAndServeListByPageId
(
Long
resourcePageId
,
Boolean
isWechat
,
Long
bookId
,
Long
adviserId
,
Long
channelId
,
Integer
enableAdverting
)
{
List
<
ResourceColumnAndServeVO
>
serveVOS
=
resourcePageColumnDao
.
getColumnListByPageId
(
resourcePageId
);
List
<
ResourceColumnAndServeVO
>
serveVOS
=
resourcePageColumnDao
.
getColumnListByPageId
(
resourcePageId
);
...
@@ -1200,6 +1218,16 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
...
@@ -1200,6 +1218,16 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
}
}
}
}
// 更新实体书购买
List
<
ResourcePageBookstore
>
resourcePageBookstoreList
=
updateResourcePageVO
.
getResourcePageBookstoreList
();
resourcePageBookstoreBiz
.
deleteByResourcePageId
(
resourcePageId
);
if
(
CollUtil
.
isNotEmpty
(
resourcePageBookstoreList
)){
for
(
ResourcePageBookstore
bookstore
:
resourcePageBookstoreList
)
{
bookstore
.
setResourcePageId
(
resourcePageId
);
}
resourcePageBookstoreBiz
.
insert
(
resourcePageBookstoreList
);
}
//发送编辑任务queue
//发送编辑任务queue
adviserTaskConsr
.
sendAdviserTaskQueue
(
updateResourcePageVO
.
getCreateUser
(),
AdviserTaskConstants
.
TargetTypeEnum
.
QRCODE
.
getValue
(),
adviserTaskConsr
.
sendAdviserTaskQueue
(
updateResourcePageVO
.
getCreateUser
(),
AdviserTaskConstants
.
TargetTypeEnum
.
QRCODE
.
getValue
(),
page
.
getBookGroupId
()
==
null
?
page
.
getSceneId
()
:
page
.
getBookGroupId
(),
page
.
getBookGroupId
()
==
null
?
page
.
getSceneId
()
:
page
.
getBookGroupId
(),
...
@@ -1226,6 +1254,8 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
...
@@ -1226,6 +1254,8 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
//查收藏状态
//查收藏状态
ResourcePageCollect
collect
=
resourcePageCollectDao
.
getCollectRecordByUser
(
wechatUserId
,
resourcePageVO
.
getId
());
ResourcePageCollect
collect
=
resourcePageCollectDao
.
getCollectRecordByUser
(
wechatUserId
,
resourcePageVO
.
getId
());
resourcePageVO
.
setCollectState
(
null
==
collect
?
0
:
1
);
resourcePageVO
.
setCollectState
(
null
==
collect
?
0
:
1
);
// 实体店铺
resourcePageVO
.
setResourcePageBookstoreList
(
resourcePageBookstoreBiz
.
getByResourcePageId
(
resourcePageVO
.
getId
(),
resourcePageVO
.
getChannelId
()));
}
}
if
(
null
!=
resourcePageVO
.
getAdviserId
())
{
if
(
null
!=
resourcePageVO
.
getAdviserId
())
{
resourcePageVO
.
setPushTextOpenStatus
(
qrcodeSceneConsr
.
getPushTextOpenStatus
(
resourcePageVO
.
getAdviserId
()));
resourcePageVO
.
setPushTextOpenStatus
(
qrcodeSceneConsr
.
getPushTextOpenStatus
(
resourcePageVO
.
getAdviserId
()));
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/ResourcePageBookstoreBizImpl.java
0 → 100644
View file @
9bf22f1b
package
com
.
pcloud
.
book
.
group
.
biz
.
impl
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.pcloud.appcenter.app.dto.AppDto
;
import
com.pcloud.book.consumer.app.AppConsr
;
import
com.pcloud.book.consumer.channel.QrcodeSceneConsr
;
import
com.pcloud.book.consumer.resource.ProductConsr
;
import
com.pcloud.book.group.entity.ResourcePageBookstore
;
import
com.pcloud.book.group.dao.ResourcePageBookstoreDao
;
import
com.pcloud.book.group.biz.ResourcePageBookstoreBiz
;
import
com.pcloud.book.group.tools.SendWeixinRequestTools
;
import
com.pcloud.book.group.vo.ResourcePageBookstoreVO
;
import
com.pcloud.channelcenter.wechat.dto.AccountSettingDto
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.NumberUtil
;
import
com.pcloud.resourcecenter.product.dto.ProductDto
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* 实体书购买(ResourcePageBookstore)表服务实现类
*
* @author makejava
* @since 2021-08-16 14:40:27
*/
@Service
(
"resourcePageBookstoreBiz"
)
public
class
ResourcePageBookstoreBizImpl
implements
ResourcePageBookstoreBiz
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ResourcePageBookstoreBizImpl
.
class
);
@Autowired
private
ResourcePageBookstoreDao
resourcePageBookstoreDao
;
@Autowired
private
AppConsr
appConsr
;
@Autowired
private
ProductConsr
productConsr
;
@Autowired
private
QrcodeSceneConsr
qrcodeSceneConsr
;
@Override
public
ResourcePageBookstore
getById
(
Long
id
)
{
return
resourcePageBookstoreDao
.
getById
(
id
);
}
@Override
public
PageBeanNew
getList
(
Integer
currentPage
,
Integer
numPerPage
)
{
PageBeanNew
pageBeanNew
=
resourcePageBookstoreDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
null
,
"getList"
);
List
recordList
=
pageBeanNew
.
getRecordList
();
if
(
ListUtils
.
isEmpty
(
recordList
)){
return
pageBeanNew
;
}
// 加载其它数据
return
pageBeanNew
;
}
@Override
public
Long
insert
(
ResourcePageBookstore
resourcePageBookstore
)
{
resourcePageBookstoreDao
.
insert
(
resourcePageBookstore
);
return
resourcePageBookstore
.
getId
();
}
@Override
public
void
insert
(
List
<
ResourcePageBookstore
>
list
)
{
resourcePageBookstoreDao
.
insert
(
list
);
}
@Override
public
void
update
(
ResourcePageBookstore
resourcePageBookstore
)
{
if
(
resourcePageBookstore
==
null
||
!
NumberUtil
.
isNumber
(
resourcePageBookstore
.
getId
())){
throw
BizException
.
PARAM_DELETION
;
}
resourcePageBookstoreDao
.
update
(
resourcePageBookstore
);
}
@Override
public
void
deleteById
(
Long
id
)
{
resourcePageBookstoreDao
.
deleteById
(
id
);
}
@Override
public
void
deleteByResourcePageId
(
Long
resourcePageId
)
{
resourcePageBookstoreDao
.
deleteByResourcePageId
(
resourcePageId
);
}
@Override
public
List
<
ResourcePageBookstoreVO
>
getByResourcePageId
(
Long
resourcePageId
,
Long
channelId
)
{
List
<
ResourcePageBookstoreVO
>
list
=
resourcePageBookstoreDao
.
getByResourcePageId
(
resourcePageId
);
if
(
CollUtil
.
isEmpty
(
list
)
||
channelId
==
null
){
return
CollUtil
.
toList
();
}
List
<
Long
>
appIds
=
list
.
stream
().
filter
(
x
->
ObjectUtil
.
equal
(
x
.
getServeType
(),
"APP"
)).
map
(
x
->
x
.
getServeId
()).
collect
(
Collectors
.
toList
());
List
<
Long
>
productIds
=
list
.
stream
().
filter
(
x
->
ObjectUtil
.
equal
(
x
.
getServeType
(),
"PRODUCT"
)).
map
(
x
->
x
.
getServeId
()).
collect
(
Collectors
.
toList
());
Map
<
Long
,
AppDto
>
appDtoMap
=
appConsr
.
getBaseByIds
(
appIds
);
Map
<
Long
,
ProductDto
>
productDtoMap
=
productConsr
.
getProBasesByIds
(
productIds
);
AccountSettingDto
accountSettingDto
=
qrcodeSceneConsr
.
getWechatInfo
(
channelId
);
if
(
null
==
accountSettingDto
)
{
LOGGER
.
info
(
"未配置公众号"
);
return
CollUtil
.
toList
();
}
for
(
ResourcePageBookstoreVO
vo
:
list
)
{
if
(
ObjectUtil
.
equal
(
vo
.
getServeType
(),
"APP"
)){
AppDto
appDto
=
appDtoMap
.
get
(
vo
.
getServeId
());
if
(
appDto
==
null
){
continue
;
}
vo
.
setServeName
(
appDto
.
getTitle
());
vo
.
setServePic
(
appDto
.
getSquareImg
());
vo
.
setServeTypeCode
(
appDto
.
getTypeCode
());
vo
.
setServeTypeName
(
appDto
.
getTypeName
());
vo
.
setResultUrl
(
SendWeixinRequestTools
.
splitUrl
(
accountSettingDto
,
vo
.
getLinkUrl
()));
}
if
(
ObjectUtil
.
equal
(
vo
.
getServeType
(),
"PRODUCT"
)){
ProductDto
productDto
=
productDtoMap
.
get
(
vo
.
getServeId
());
if
(
productDto
==
null
){
continue
;
}
vo
.
setServeName
(
productDto
.
getProductName
());
vo
.
setServePic
(
productDto
.
getCoverImg
());
if
(
productDto
.
getProductTypeDto
()
!=
null
){
vo
.
setServeTypeCode
(
productDto
.
getProductTypeDto
().
getTypeCode
());
vo
.
setServeTypeName
(
productDto
.
getProductTypeDto
().
getTypeName
());
}
vo
.
setResultUrl
(
SendWeixinRequestTools
.
splitUrl
(
accountSettingDto
,
vo
.
getLinkUrl
()));
}
}
return
list
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/ResourcePageBookstoreDao.java
0 → 100644
View file @
9bf22f1b
package
com
.
pcloud
.
book
.
group
.
dao
;
import
com.pcloud.book.group.entity.ResourcePageBookstore
;
import
com.pcloud.book.group.vo.ResourcePageBookstoreVO
;
import
com.pcloud.common.core.dao.BaseDao
;
import
java.util.List
;
/**
* 实体书购买(ResourcePageBookstore)表数据库访问层
*
* @author makejava
* @since 2021-08-16 14:40:27
*/
public
interface
ResourcePageBookstoreDao
extends
BaseDao
<
ResourcePageBookstore
>
{
Integer
deleteByResourcePageId
(
Long
resourcePageId
);
List
<
ResourcePageBookstoreVO
>
getByResourcePageId
(
Long
resourcePageId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/impl/ResourcePageBookstoreDaoImpl.java
0 → 100644
View file @
9bf22f1b
package
com
.
pcloud
.
book
.
group
.
dao
.
impl
;
import
com.pcloud.book.group.entity.ResourcePageBookstore
;
import
com.pcloud.book.group.dao.ResourcePageBookstoreDao
;
import
com.pcloud.book.group.vo.ResourcePageBookstoreVO
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Repository
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 实体书购买(ResourcePageBookstore)表数据库访问层
*
* @author makejava
* @since 2021-08-16 14:40:27
*/
@Repository
(
"resourcePageBookstoreDaoImpl"
)
public
class
ResourcePageBookstoreDaoImpl
extends
BaseDaoImpl
<
ResourcePageBookstore
>
implements
ResourcePageBookstoreDao
{
@Override
public
Integer
deleteByResourcePageId
(
Long
resourcePageId
)
{
return
super
.
sqlSessionTemplate
.
delete
(
getStatement
(
"deleteByResourcePageId"
),
resourcePageId
);
}
@Override
public
List
<
ResourcePageBookstoreVO
>
getByResourcePageId
(
Long
resourcePageId
)
{
return
super
.
sqlSessionTemplate
.
selectList
(
getStatement
(
"getByResourcePageId"
),
resourcePageId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/entity/ResourcePageBookstore.java
0 → 100644
View file @
9bf22f1b
package
com
.
pcloud
.
book
.
group
.
entity
;
import
java.util.Date
;
import
java.math.BigDecimal
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.pcloud.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* 实体书购买(ResourcePageBookstore)实体类
*
* @author makejava
* @since 2021-08-16 14:40:27
*/
@Data
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
ResourcePageBookstore
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
537657968168101067L
;
@ApiModelProperty
(
"实体书购买id"
)
private
Long
id
;
@ApiModelProperty
(
"资源页id"
)
private
Long
resourcePageId
;
@ApiModelProperty
(
"服务id"
)
private
Long
serveId
;
@ApiModelProperty
(
"服务类型;APP/PRODUCT"
)
private
String
serveType
;
@ApiModelProperty
(
"应用作品相对链接"
)
private
String
linkUrl
;
@ApiModelProperty
(
"创建时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
createTime
;
}
pcloud-service-book/src/main/java/com/pcloud/book/group/vo/ResourcePageBookstoreVO.java
0 → 100644
View file @
9bf22f1b
package
com
.
pcloud
.
book
.
group
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.pcloud.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
/**
* 实体书购买(ResourcePageBookstore)实体类
*
* @author makejava
* @since 2021-08-16 14:40:27
*/
@Data
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
ResourcePageBookstoreVO
{
@ApiModelProperty
(
"实体书购买id"
)
private
Long
id
;
@ApiModelProperty
(
"资源页id"
)
private
Long
resourcePageId
;
@ApiModelProperty
(
"服务id"
)
private
Long
serveId
;
@ApiModelProperty
(
"相对链接"
)
private
String
linkUrl
;
@ApiModelProperty
(
"跳转结果页链接"
)
private
String
resultUrl
;
@ApiModelProperty
(
"服务类型;APP/PRODUCT"
)
private
String
serveType
;
@ApiModelProperty
(
"服务名称"
)
private
String
serveName
;
@ApiModelProperty
(
"图片"
)
private
String
servePic
;
@ApiModelProperty
(
"服务类型"
)
private
String
serveTypeCode
;
@ApiModelProperty
(
"服务类型名称"
)
private
String
serveTypeName
;
@ApiModelProperty
(
"创建时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
createTime
;
}
pcloud-service-book/src/main/java/com/pcloud/book/group/vo/ResourcePageVO.java
View file @
9bf22f1b
...
@@ -2,8 +2,11 @@ package com.pcloud.book.group.vo;
...
@@ -2,8 +2,11 @@ package com.pcloud.book.group.vo;
import
com.pcloud.common.dto.BaseDto
;
import
com.pcloud.common.dto.BaseDto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.List
;
/**
/**
* 自有码H5页面(ResourcePage)实体类
* 自有码H5页面(ResourcePage)实体类
*
*
...
@@ -88,4 +91,7 @@ public class ResourcePageVO extends BaseDto {
...
@@ -88,4 +91,7 @@ public class ResourcePageVO extends BaseDto {
* 背景图
* 背景图
*/
*/
private
String
backgroundImg
;
private
String
backgroundImg
;
@ApiModelProperty
(
"实体书购买"
)
private
List
<
ResourcePageBookstoreVO
>
resourcePageBookstoreList
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/vo/UpdateResourcePageVO.java
View file @
9bf22f1b
...
@@ -4,6 +4,7 @@ import java.util.List;
...
@@ -4,6 +4,7 @@ import java.util.List;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.NotNull
;
import
com.pcloud.book.group.entity.ResourcePageBookstore
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -58,4 +59,7 @@ public class UpdateResourcePageVO {
...
@@ -58,4 +59,7 @@ public class UpdateResourcePageVO {
* 背景图
* 背景图
*/
*/
private
String
backgroundImg
;
private
String
backgroundImg
;
@ApiModelProperty
(
"实体书购买"
)
private
List
<
ResourcePageBookstore
>
resourcePageBookstoreList
;
}
}
pcloud-service-book/src/main/resources/mapper/group/ResourcePageBookstore.Mapper.xml
0 → 100644
View file @
9bf22f1b
<?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.group.dao.impl.ResourcePageBookstoreDaoImpl"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.group.entity.ResourcePageBookstore"
>
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"resource_page_id"
property=
"resourcePageId"
jdbcType=
"BIGINT"
/>
<result
column=
"serve_id"
property=
"serveId"
jdbcType=
"BIGINT"
/>
<result
column=
"serve_type"
property=
"serveType"
jdbcType=
"VARCHAR"
/>
<result
column=
"link_url"
property=
"linkUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<resultMap
id=
"BaseDtoResultMap"
extends=
"BaseResultMap"
type=
"com.pcloud.book.group.vo.ResourcePageBookstoreVO"
>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, resource_page_id, serve_id, serve_type, link_url, create_time
</sql>
<select
id=
"getById"
resultMap=
"BaseResultMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM resource_page_bookstore
WHERE id = #{id}
</select>
<select
id=
"getByResourcePageId"
resultMap=
"BaseDtoResultMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM resource_page_bookstore
WHERE resource_page_id = #{resourcePageId}
</select>
<select
id=
"getList"
resultMap=
"BaseResultMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM resource_page_bookstore
</select>
<insert
id=
"insert"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
INSERT INTO resource_page_bookstore(
resource_page_id,
serve_id,
serve_type,
link_url,
create_time
) VALUES (
#{resourcePageId, jdbcType=BIGINT},
#{serveId, jdbcType=BIGINT},
#{serveType, jdbcType=VARCHAR},
#{linkUrl, jdbcType=VARCHAR},
NOW()
)
</insert>
<insert
id=
"batchInsert"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
INSERT INTO resource_page_bookstore (
resource_page_id,
serve_id,
serve_type,
link_url,
create_time
) VALUES
<foreach
collection=
"list"
item=
"item"
separator=
","
>
(
#{item.resourcePageId, jdbcType=BIGINT},
#{item.serveId, jdbcType=BIGINT},
#{item.serveType, jdbcType=VARCHAR},
#{item.linkUrl, jdbcType=VARCHAR},
NOW()
)
</foreach>
</insert>
<!--通过主键修改数据-->
<update
id=
"update"
>
UPDATE resource_page_bookstore
<set>
<if
test=
"resourcePageId != null"
>
resource_page_id = #{resourcePageId},
</if>
<if
test=
"serveId != null"
>
serve_id = #{serveId},
</if>
<if
test=
"serveType != null and serveType != ''"
>
serve_type = #{serveType},
</if>
<if
test=
"linkUrl != null and linkUrl != ''"
>
link_url = #{linkUrl},
</if>
</set>
WHERE id = #{id}
</update>
<!--通过主键删除-->
<delete
id=
"deleteById"
>
DELETE FROM resource_page_bookstore WHERE id = #{id}
</delete>
<!--通过主键删除-->
<delete
id=
"deleteByResourcePageId"
>
DELETE FROM resource_page_bookstore WHERE resource_page_id = #{resourcePageId}
</delete>
</mapper>
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