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
b9ec0883
Commit
b9ec0883
authored
Apr 22, 2019
by
gaopeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
社群码
parent
7268c451
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
1310 additions
and
1 deletions
+1310
-1
pom.xml
pcloud-service-book/pom.xml
+7
-0
BookApplication.java
...e-book/src/main/java/com/pcloud/book/BookApplication.java
+1
-1
BookGroupBiz.java
...src/main/java/com/pcloud/book/group/biz/BookGroupBiz.java
+73
-0
BookGroupBizImpl.java
...java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
+230
-0
BookGroupDao.java
...src/main/java/com/pcloud/book/group/dao/BookGroupDao.java
+46
-0
BookGroupDaoImpl.java
...java/com/pcloud/book/group/dao/impl/BookGroupDaoImpl.java
+61
-0
BookGroupDTO.java
...src/main/java/com/pcloud/book/group/dto/BookGroupDTO.java
+292
-0
BookGroup.java
...src/main/java/com/pcloud/book/group/entity/BookGroup.java
+245
-0
BookGroupFacade.java
...in/java/com/pcloud/book/group/facade/BookGroupFacade.java
+98
-0
BookGroupFacadeImpl.java
...om/pcloud/book/group/facade/impl/BookGroupFacadeImpl.java
+85
-0
BookGroupMapper.xml
...-book/src/main/resources/mapper/group/BookGroupMapper.xml
+171
-0
pom.xml
pom.xml
+1
-0
No files found.
pcloud-service-book/pom.xml
View file @
b9ec0883
...
@@ -138,6 +138,13 @@
...
@@ -138,6 +138,13 @@
<artifactId>
pcloud-facade-readercenter
</artifactId>
<artifactId>
pcloud-facade-readercenter
</artifactId>
<version>
${pcloud-facade-readercenter.version}
</version>
<version>
${pcloud-facade-readercenter.version}
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.pcloud.facade
</groupId>
<artifactId>
pcloud-facade-labelcenter
</artifactId>
<version>
${pcloud-facade-labelcenter.version}
</version>
</dependency>
<dependency>
<dependency>
<groupId>
fakepath
</groupId>
<groupId>
fakepath
</groupId>
<artifactId>
jbarcode
</artifactId>
<artifactId>
jbarcode
</artifactId>
...
...
pcloud-service-book/src/main/java/com/pcloud/book/BookApplication.java
View file @
b9ec0883
...
@@ -33,7 +33,7 @@ import java.util.ArrayList;
...
@@ -33,7 +33,7 @@ import java.util.ArrayList;
@ComponentScan
(
"com.pcloud"
)
@ComponentScan
(
"com.pcloud"
)
@EnableEurekaClient
@EnableEurekaClient
@EnableFeignClients
(
"com.pcloud"
)
@EnableFeignClients
(
"com.pcloud"
)
@PropertySource
s
(
@PropertySource
(
value
=
"classpath:properties/book.properties"
)
)
@PropertySource
({
"classpath:properties/book.properties"
,
"classpath:public_system.properties"
}
)
@Configuration
@Configuration
@EnableSwagger2
@EnableSwagger2
public
class
BookApplication
{
public
class
BookApplication
{
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/BookGroupBiz.java
0 → 100644
View file @
b9ec0883
package
com
.
pcloud
.
book
.
group
.
biz
;
import
java.util.Map
;
import
com.pcloud.book.group.dto.BookGroupDTO
;
import
com.pcloud.book.group.entity.BookGroup
;
import
com.pcloud.common.exceptions.BizException
;
/**
* Description 社群书群二维码业务逻辑层接口
* Created by PENG on 2019/4/17.
*/
public
interface
BookGroupBiz
{
/**
* 创建社群书时生成群二维码
* @param bookId 书刊ID
* @param channelId 运营ID
* @param adviserId 编辑ID
* @throws BizException
*/
BookGroup
createBookGroupAfterCreateBook
(
Long
bookId
,
Long
channelId
,
Long
adviserId
)
throws
BizException
;
/**
* 获取社群书群二维码信息
* @param bookGroupId 群二维码ID
* @return
* @throws BizException
*/
BookGroupDTO
getBookGroupInfo
(
Long
bookGroupId
)
throws
BizException
;
/**
* 获取社群书群二维码信息
* @param bookId 书刊ID
* @param channelId 运营ID
* @param adviserId 编辑ID
* @return
* @throws BizException
*/
BookGroupDTO
getBookGroupInfoByBookId
(
Long
bookId
,
Long
channelId
,
Long
adviserId
)
throws
BizException
;
/**
* 更新群二维码信息
* @param bookGroup 群二维码实体
* @throws BizException
*/
void
updateBookGroup
(
BookGroup
bookGroup
)
throws
BizException
;
/**
* 根据书刊ID删除
* @param bookId 书刊ID
* @param channelId 运营ID
* @param adviserId 编辑ID
* @throws BizException
*/
void
deleteByBookId
(
Long
bookId
,
Long
channelId
,
Long
adviserId
)
throws
BizException
;
/**
* 根据书刊ID恢复
* @param bookId 书刊ID
* @param channelId 运营ID
* @param adviserId 编辑ID
* @throws BizException
*/
void
recoverByBookId
(
Long
bookId
,
Long
channelId
,
Long
adviserId
)
throws
BizException
;
/**
* 根据社群码ID获取书名
* @param bookGroupId 社群码ID
* @return
* @throws BizException
*/
Map
<
String
,
Object
>
getBookNameByBookGroupId
(
Long
bookGroupId
)
throws
BizException
;
}
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
0 → 100644
View file @
b9ec0883
package
com
.
pcloud
.
book
.
group
.
biz
.
impl
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.commons.collections.MapUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.book.biz.BookBiz
;
import
com.pcloud.book.book.dto.BookDto
;
import
com.pcloud.book.consumer.user.AdviserConsr
;
import
com.pcloud.book.group.biz.BookGroupBiz
;
import
com.pcloud.book.group.dao.BookGroupDao
;
import
com.pcloud.book.group.dto.BookGroupDTO
;
import
com.pcloud.book.group.entity.BookGroup
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.core.constant.ProductTypeConstant
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.QrcodeUtils
;
import
com.pcloud.common.utils.ResponseHandleUtil
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.labelcenter.label.service.LabelService
;
import
com.pcloud.resourcecenter.product.dto.AddAppProductParamDTO
;
import
com.pcloud.resourcecenter.product.dto.UpdateAppProductParamDTO
;
import
com.pcloud.resourcecenter.product.entity.Product
;
import
com.pcloud.resourcecenter.product.service.ProductService
;
/**
* Description 社群书群二维码业务逻辑层接口实现类
* Created by PENG on 2019/4/17.
*/
@Component
(
"bookGroupBiz"
)
public
class
BookGroupBizImpl
implements
BookGroupBiz
{
private
final
static
String
DEFAULT_PRODUCT_COVER_IMG
=
"https://oss.5rs.me/oss/uploadfe/png/1c5da08d2c9598a5f0b0252acb84d8b8.png"
;
@Value
(
"${book.group.qrcode.domain}"
)
private
String
bookGroupQrcodeDomain
;
@Autowired
private
BookGroupDao
bookGroupDao
;
@Autowired
private
LabelService
labelService
;
@Autowired
private
ProductService
productService
;
@Autowired
private
AdviserConsr
adviserConsr
;
@Autowired
private
BookBiz
bookBiz
;
/**
* 创建社群书时生成群二维码
*/
@Override
@ParamLog
(
"创建社群书时生成群二维码"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BookGroup
createBookGroupAfterCreateBook
(
Long
bookId
,
Long
channelId
,
Long
adviserId
)
throws
BizException
{
BookGroup
bookGroup
=
new
BookGroup
();
bookGroup
.
setBookId
(
bookId
);
bookGroup
.
setChannelId
(
channelId
);
bookGroup
.
setCreateUser
(
adviserId
);
bookGroupDao
.
insert
(
bookGroup
);
String
groupQrcodeUrl
=
QrcodeUtils
.
createWithMargin
(
bookGroupQrcodeDomain
+
"/"
+
bookGroup
.
getId
(),
1
);
BookGroup
group
=
new
BookGroup
();
group
.
setId
(
bookGroup
.
getId
());
group
.
setGroupQrcodeUrl
(
groupQrcodeUrl
);
bookGroupDao
.
update
(
group
);
bookGroup
.
setGroupQrcodeUrl
(
groupQrcodeUrl
);
return
bookGroup
;
}
/**
* 获取社群书群二维码信息
*/
@Override
public
BookGroupDTO
getBookGroupInfo
(
Long
bookGroupId
)
throws
BizException
{
BookGroupDTO
bookGroupDTO
=
bookGroupDao
.
getDTOById
(
bookGroupId
);
if
(
null
==
bookGroupDTO
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"群二维码不存在!"
);
}
List
<
Long
>
labelIds
=
new
ArrayList
<>();
if
(
null
!=
bookGroupDTO
.
getProLabelId
())
{
labelIds
.
add
(
bookGroupDTO
.
getProLabelId
());
}
if
(
null
!=
bookGroupDTO
.
getDepLabelId
())
{
labelIds
.
add
(
bookGroupDTO
.
getDepLabelId
());
}
if
(
null
!=
bookGroupDTO
.
getPurLabelId
())
{
labelIds
.
add
(
bookGroupDTO
.
getPurLabelId
());
}
if
(
ListUtils
.
isEmpty
(
labelIds
))
{
Map
<
Long
,
String
>
labelMap
=
ResponseHandleUtil
.
parseMap
(
labelService
.
getLabelName
(
labelIds
),
Long
.
class
,
String
.
class
);
if
(!
MapUtils
.
isEmpty
(
labelMap
))
{
if
(
null
!=
bookGroupDTO
.
getProLabelId
()
&&
labelMap
.
containsKey
(
bookGroupDTO
.
getProLabelId
()))
{
bookGroupDTO
.
setProLabelName
(
labelMap
.
get
(
bookGroupDTO
.
getProLabelId
()));
}
if
(
null
!=
bookGroupDTO
.
getDepLabelId
()
&&
labelMap
.
containsKey
(
bookGroupDTO
.
getDepLabelId
()))
{
bookGroupDTO
.
setDepLabelName
(
labelMap
.
get
(
bookGroupDTO
.
getDepLabelId
()));
}
if
(
null
!=
bookGroupDTO
.
getPurLabelId
()
&&
labelMap
.
containsKey
(
bookGroupDTO
.
getPurLabelId
()))
{
bookGroupDTO
.
setPurLabelName
(
labelMap
.
get
(
bookGroupDTO
.
getPurLabelId
()));
}
}
}
return
bookGroupDTO
;
}
/**
* 获取社群书群二维码信息
*/
@Override
public
BookGroupDTO
getBookGroupInfoByBookId
(
Long
bookId
,
Long
channelId
,
Long
adviserId
)
throws
BizException
{
BookGroupDTO
bookGroupDTO
=
bookGroupDao
.
getDTOByBookId
(
bookId
,
channelId
,
adviserId
);
if
(
null
==
bookGroupDTO
)
{
BookGroup
bookGroup
=
this
.
createBookGroupAfterCreateBook
(
bookId
,
channelId
,
adviserId
);
bookGroupDTO
=
new
BookGroupDTO
();
bookGroupDTO
.
setId
(
bookGroup
.
getId
());
bookGroupDTO
.
setBookId
(
bookId
);
bookGroupDTO
.
setChannelId
(
channelId
);
bookGroupDTO
.
setGroupQrcodeUrl
(
bookGroup
.
getGroupQrcodeUrl
());
bookGroupDTO
.
setCreateUser
(
adviserId
);
}
List
<
Long
>
labelIds
=
new
ArrayList
<>();
if
(
null
!=
bookGroupDTO
.
getProLabelId
())
{
labelIds
.
add
(
bookGroupDTO
.
getProLabelId
());
}
if
(
null
!=
bookGroupDTO
.
getDepLabelId
())
{
labelIds
.
add
(
bookGroupDTO
.
getDepLabelId
());
}
if
(
null
!=
bookGroupDTO
.
getPurLabelId
())
{
labelIds
.
add
(
bookGroupDTO
.
getPurLabelId
());
}
if
(!
ListUtils
.
isEmpty
(
labelIds
))
{
Map
<
Long
,
String
>
labelMap
=
ResponseHandleUtil
.
parseMap
(
labelService
.
getLabelName
(
labelIds
),
Long
.
class
,
String
.
class
);
if
(!
MapUtils
.
isEmpty
(
labelMap
))
{
if
(
null
!=
bookGroupDTO
.
getProLabelId
()
&&
labelMap
.
containsKey
(
bookGroupDTO
.
getProLabelId
()))
{
bookGroupDTO
.
setProLabelName
(
labelMap
.
get
(
bookGroupDTO
.
getProLabelId
()));
}
if
(
null
!=
bookGroupDTO
.
getDepLabelId
()
&&
labelMap
.
containsKey
(
bookGroupDTO
.
getDepLabelId
()))
{
bookGroupDTO
.
setDepLabelName
(
labelMap
.
get
(
bookGroupDTO
.
getDepLabelId
()));
}
if
(
null
!=
bookGroupDTO
.
getPurLabelId
()
&&
labelMap
.
containsKey
(
bookGroupDTO
.
getPurLabelId
()))
{
bookGroupDTO
.
setPurLabelName
(
labelMap
.
get
(
bookGroupDTO
.
getPurLabelId
()));
}
}
}
return
bookGroupDTO
;
}
/**
* 更新群二维码信息
*/
@Override
@ParamLog
(
value
=
"更新群二维码信息"
,
isAfterReturn
=
false
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
updateBookGroup
(
BookGroup
bookGroup
)
throws
BizException
{
if
(
null
==
bookGroup
.
getId
()
||
StringUtil
.
isEmpty
(
bookGroup
.
getGroupQrcodeName
())
||
null
==
bookGroup
.
getProLabelId
()
||
null
==
bookGroup
.
getDepLabelId
()
||
null
==
bookGroup
.
getPurLabelId
()
||
StringUtil
.
isEmpty
(
bookGroup
.
getJoinTitle
())
||
StringUtil
.
isEmpty
(
bookGroup
.
getJoinSlogan
())
||
StringUtil
.
isEmpty
(
bookGroup
.
getPersonalQrcodeUrl
()))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数有误!"
);
}
BookGroup
group
=
bookGroupDao
.
getById
(
bookGroup
.
getId
());
if
(
null
==
group
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"群二维码不存在!"
);
}
/*if (null == group.getProductId()) {
AddAppProductParamDTO addAppProductParamDTO = new AddAppProductParamDTO();
addAppProductParamDTO.setAppProCode(ProductTypeConstant.BOOK_GROUP);
addAppProductParamDTO.setAppProName(bookGroup.getGroupQrcodeName());
addAppProductParamDTO.setCoverImg(DEFAULT_PRODUCT_COVER_IMG);
addAppProductParamDTO.setPartyId(group.getCreateUser());
addAppProductParamDTO.setChannelId(group.getChannelId());
Long agentId = adviserConsr.getAgentIdByAdviser(group.getCreateUser());
addAppProductParamDTO.setAgentId(agentId);
Product product = ResponseHandleUtil.parseResponse(productService.postAddBookGroupProduct(addAppProductParamDTO), Product.class);
if (null == product) {
throw new BookBizException(BookBizException.DB_DML_FAIL, "操作失败!");
}
bookGroup.setProductId(product.getProductId());
} else {
UpdateAppProductParamDTO updateAppProductParamDTO = new UpdateAppProductParamDTO();
updateAppProductParamDTO.setProductId(group.getProductId());
updateAppProductParamDTO.setChannelId(group.getChannelId());
updateAppProductParamDTO.setAppProName(bookGroup.getGroupQrcodeName());
ResponseHandleUtil.parseResponse(productService.postUpdateBookGroupProduct(updateAppProductParamDTO), Product.class);
}
bookGroupDao.update(bookGroup);*/
}
/**
* 根据书刊ID删除
*/
@Override
@ParamLog
(
value
=
"根据书刊ID删除"
,
isAfterReturn
=
false
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
deleteByBookId
(
Long
bookId
,
Long
channelId
,
Long
adviserId
)
throws
BizException
{
bookGroupDao
.
deleteByBookId
(
bookId
,
channelId
,
adviserId
);
}
/**
* 根据书刊ID恢复
*/
@Override
@ParamLog
(
value
=
"根据书刊ID恢复"
,
isAfterReturn
=
false
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
recoverByBookId
(
Long
bookId
,
Long
channelId
,
Long
adviserId
)
throws
BizException
{
bookGroupDao
.
recoverByBookId
(
bookId
,
channelId
,
adviserId
);
}
/**
* 根据社群码ID获取书名
*/
@Override
public
Map
<
String
,
Object
>
getBookNameByBookGroupId
(
Long
bookGroupId
)
throws
BizException
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
BookGroupDTO
bookGroupDTO
=
bookGroupDao
.
getDTOById
(
bookGroupId
);
if
(
null
!=
bookGroupDTO
&&
null
!=
bookGroupDTO
.
getBookId
())
{
BookDto
bookDto
=
bookBiz
.
getBaseById
(
bookGroupDTO
.
getBookId
());
if
(
null
!=
bookDto
)
{
result
.
put
(
"bookName"
,
StringUtil
.
addBracket
(
bookDto
.
getBookName
()));
}
}
return
result
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/BookGroupDao.java
0 → 100644
View file @
b9ec0883
package
com
.
pcloud
.
book
.
group
.
dao
;
import
com.pcloud.book.group.dto.BookGroupDTO
;
import
com.pcloud.book.group.entity.BookGroup
;
import
com.pcloud.common.core.dao.BaseDao
;
/**
* Description 社群书群二维码数据访问层接口
* Created by PENG on 2019/4/17.
*/
public
interface
BookGroupDao
extends
BaseDao
<
BookGroup
>
{
/**
* 获取DTO信息
* @param bookGroupId 群二维码ID
* @return
*/
BookGroupDTO
getDTOById
(
Long
bookGroupId
);
/**
* 获取DTO信息
* @param bookId 书刊ID
* @param channelId 运营ID
* @param adviserId 编辑ID
* @return
*/
BookGroupDTO
getDTOByBookId
(
Long
bookId
,
Long
channelId
,
Long
adviserId
);
/**
* 根据书刊ID删除
* @param bookId 书刊ID
* @param channelId 运营ID
* @param adviserId 编辑ID
* @return
*/
long
deleteByBookId
(
Long
bookId
,
Long
channelId
,
Long
adviserId
);
/**
* 根据书刊ID恢复
* @param bookId 书刊ID
* @param channelId 运营ID
* @param adviserId 编辑ID
* @return
*/
long
recoverByBookId
(
Long
bookId
,
Long
channelId
,
Long
adviserId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/impl/BookGroupDaoImpl.java
0 → 100644
View file @
b9ec0883
package
com
.
pcloud
.
book
.
group
.
dao
.
impl
;
import
java.util.HashMap
;
import
java.util.Map
;
import
org.springframework.stereotype.Repository
;
import
com.pcloud.book.group.dao.BookGroupDao
;
import
com.pcloud.book.group.dto.BookGroupDTO
;
import
com.pcloud.book.group.entity.BookGroup
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
/**
* Description 社群书群二维码数据访问层接口实现类
* Created by PENG on 2019/4/17.
*/
@Repository
(
"bookGroupDao"
)
public
class
BookGroupDaoImpl
extends
BaseDaoImpl
<
BookGroup
>
implements
BookGroupDao
{
/**
* 获取DTO信息
*/
@Override
public
BookGroupDTO
getDTOById
(
Long
bookGroupId
)
{
return
super
.
getSqlSession
().
selectOne
(
getStatement
(
"getDTOById"
),
bookGroupId
);
}
/**
* 获取DTO信息
*/
@Override
public
BookGroupDTO
getDTOByBookId
(
Long
bookId
,
Long
channelId
,
Long
adviserId
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"bookId"
,
bookId
);
paramMap
.
put
(
"channelId"
,
channelId
);
paramMap
.
put
(
"adviserId"
,
adviserId
);
return
super
.
getSqlSession
().
selectOne
(
getStatement
(
"getDTOByBookId"
),
paramMap
);
}
/**
* 根据书刊ID删除
*/
@Override
public
long
deleteByBookId
(
Long
bookId
,
Long
channelId
,
Long
adviserId
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"bookId"
,
bookId
);
paramMap
.
put
(
"channelId"
,
channelId
);
paramMap
.
put
(
"adviserId"
,
adviserId
);
return
super
.
getSqlSession
().
update
(
getStatement
(
"deleteByBookId"
),
paramMap
);
}
/**
* 根据书刊ID恢复
*/
@Override
public
long
recoverByBookId
(
Long
bookId
,
Long
channelId
,
Long
adviserId
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"bookId"
,
bookId
);
paramMap
.
put
(
"channelId"
,
channelId
);
paramMap
.
put
(
"adviserId"
,
adviserId
);
return
super
.
getSqlSession
().
update
(
getStatement
(
"recoverByBookId"
),
paramMap
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dto/BookGroupDTO.java
0 → 100644
View file @
b9ec0883
package
com
.
pcloud
.
book
.
group
.
dto
;
import
java.util.Date
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.pcloud.common.dto.BaseDto
;
/**
* 社群书群二维码DTO
* @author PENG
* @date 2019年4月17日11:31:16
*/
public
class
BookGroupDTO
extends
BaseDto
{
private
static
final
long
serialVersionUID
=
7620868422261683212L
;
/**
* book_group.id (唯一标识)
*/
private
Long
id
;
/**
* book_group.book_id (书刊ID)
*/
private
Long
bookId
;
/**
* book_group.channel_id (运营ID)
*/
private
Long
channelId
;
/**
* book_group.group_qrcode_url (群二维码图片)
*/
private
String
groupQrcodeUrl
;
/**
* book_group.group_qrcode_name (群二维码名称)
*/
private
String
groupQrcodeName
;
/**
* book_group.pro_label_id (专业标签ID)
*/
private
Long
proLabelId
;
/**
* 专业标签名称
*/
private
String
proLabelName
;
/**
* book_group.dep_label_id (深度标签ID)
*/
private
Long
depLabelId
;
/**
* 深度标签名称
*/
private
String
depLabelName
;
/**
* book_group.pur_label_id (目的标签ID)
*/
private
Long
purLabelId
;
/**
* 目的标签名称
*/
private
String
purLabelName
;
/**
* 选择群页面标题
*/
private
String
joinTitle
;
/**
* book_group.join_slogan (进群宣传语)
*/
private
String
joinSlogan
;
/**
* book_group.personal_qrcode_url (个人二维码)
*/
private
String
personalQrcodeUrl
;
/**
* book_group.product_id (商品ID)
*/
private
Long
productId
;
/**
* book_group.create_user (创建人)
*/
private
Long
createUser
;
/**
* book_group.create_time (创建时间)
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
createTime
;
/**
* book_group.update_time (修改时间)
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
updateTime
;
/**
* book_group.is_delete (是否删除)
*/
private
Boolean
isDelete
;
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
String
getGroupQrcodeUrl
()
{
return
groupQrcodeUrl
;
}
public
void
setGroupQrcodeUrl
(
String
groupQrcodeUrl
)
{
this
.
groupQrcodeUrl
=
groupQrcodeUrl
;
}
public
String
getGroupQrcodeName
()
{
return
groupQrcodeName
;
}
public
void
setGroupQrcodeName
(
String
groupQrcodeName
)
{
this
.
groupQrcodeName
=
groupQrcodeName
;
}
public
Long
getProLabelId
()
{
return
proLabelId
;
}
public
void
setProLabelId
(
Long
proLabelId
)
{
this
.
proLabelId
=
proLabelId
;
}
public
Long
getDepLabelId
()
{
return
depLabelId
;
}
public
void
setDepLabelId
(
Long
depLabelId
)
{
this
.
depLabelId
=
depLabelId
;
}
public
Long
getPurLabelId
()
{
return
purLabelId
;
}
public
void
setPurLabelId
(
Long
purLabelId
)
{
this
.
purLabelId
=
purLabelId
;
}
public
String
getJoinTitle
()
{
return
joinTitle
;
}
public
void
setJoinTitle
(
String
joinTitle
)
{
this
.
joinTitle
=
joinTitle
;
}
public
String
getJoinSlogan
()
{
return
joinSlogan
;
}
public
void
setJoinSlogan
(
String
joinSlogan
)
{
this
.
joinSlogan
=
joinSlogan
;
}
public
String
getPersonalQrcodeUrl
()
{
return
personalQrcodeUrl
;
}
public
void
setPersonalQrcodeUrl
(
String
personalQrcodeUrl
)
{
this
.
personalQrcodeUrl
=
personalQrcodeUrl
;
}
public
Long
getProductId
()
{
return
productId
;
}
public
void
setProductId
(
Long
productId
)
{
this
.
productId
=
productId
;
}
public
Long
getCreateUser
()
{
return
createUser
;
}
public
void
setCreateUser
(
Long
createUser
)
{
this
.
createUser
=
createUser
;
}
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
Boolean
getIsDelete
()
{
return
isDelete
;
}
public
void
setIsDelete
(
Boolean
isDelete
)
{
this
.
isDelete
=
isDelete
;
}
public
String
getProLabelName
()
{
return
proLabelName
;
}
public
void
setProLabelName
(
String
proLabelName
)
{
this
.
proLabelName
=
proLabelName
;
}
public
String
getDepLabelName
()
{
return
depLabelName
;
}
public
void
setDepLabelName
(
String
depLabelName
)
{
this
.
depLabelName
=
depLabelName
;
}
public
String
getPurLabelName
()
{
return
purLabelName
;
}
public
void
setPurLabelName
(
String
purLabelName
)
{
this
.
purLabelName
=
purLabelName
;
}
@Override
public
String
toString
()
{
return
"BookGroupDTO{"
+
"id="
+
id
+
", bookId="
+
bookId
+
", channelId="
+
channelId
+
", groupQrcodeUrl='"
+
groupQrcodeUrl
+
'\''
+
", groupQrcodeName='"
+
groupQrcodeName
+
'\''
+
", proLabelId="
+
proLabelId
+
", proLabelName='"
+
proLabelName
+
'\''
+
", depLabelId="
+
depLabelId
+
", depLabelName='"
+
depLabelName
+
'\''
+
", purLabelId="
+
purLabelId
+
", purLabelName='"
+
purLabelName
+
'\''
+
", joinTitle='"
+
joinTitle
+
'\''
+
", joinSlogan='"
+
joinSlogan
+
'\''
+
", personalQrcodeUrl='"
+
personalQrcodeUrl
+
'\''
+
", productId="
+
productId
+
", createUser="
+
createUser
+
", createTime="
+
createTime
+
", updateTime="
+
updateTime
+
", isDelete="
+
isDelete
+
"} "
+
super
.
toString
();
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/group/entity/BookGroup.java
0 → 100644
View file @
b9ec0883
package
com
.
pcloud
.
book
.
group
.
entity
;
import
java.util.Date
;
import
com.pcloud.common.entity.BaseEntity
;
/**
* 社群书群二维码实体
* @author PENG
* @date 2019年4月17日11:31:16
*/
public
class
BookGroup
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
7446049698462097220L
;
/**
* book_group.id (唯一标识)
*/
private
Long
id
;
/**
* book_group.book_id (书刊ID)
*/
private
Long
bookId
;
/**
* book_group.channel_id (运营ID)
*/
private
Long
channelId
;
/**
* book_group.group_qrcode_url (群二维码图片)
*/
private
String
groupQrcodeUrl
;
/**
* book_group.group_qrcode_name (群二维码名称)
*/
private
String
groupQrcodeName
;
/**
* book_group.pro_label_id (专业标签ID)
*/
private
Long
proLabelId
;
/**
* book_group.dep_label_id (深度标签ID)
*/
private
Long
depLabelId
;
/**
* book_group.pur_label_id (目的标签ID)
*/
private
Long
purLabelId
;
/**
* 选择群页面标题
*/
private
String
joinTitle
;
/**
* book_group.join_slogan (进群宣传语)
*/
private
String
joinSlogan
;
/**
* book_group.personal_qrcode_url (个人二维码)
*/
private
String
personalQrcodeUrl
;
/**
* book_group.product_id (商品ID)
*/
private
Long
productId
;
/**
* book_group.create_user (创建人)
*/
private
Long
createUser
;
/**
* book_group.create_time (创建时间)
*/
private
Date
createTime
;
/**
* book_group.update_time (修改时间)
*/
private
Date
updateTime
;
/**
* book_group.is_delete (是否删除)
*/
private
Boolean
isDelete
;
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
String
getGroupQrcodeUrl
()
{
return
groupQrcodeUrl
;
}
public
void
setGroupQrcodeUrl
(
String
groupQrcodeUrl
)
{
this
.
groupQrcodeUrl
=
groupQrcodeUrl
;
}
public
String
getGroupQrcodeName
()
{
return
groupQrcodeName
;
}
public
void
setGroupQrcodeName
(
String
groupQrcodeName
)
{
this
.
groupQrcodeName
=
groupQrcodeName
;
}
public
Long
getProLabelId
()
{
return
proLabelId
;
}
public
void
setProLabelId
(
Long
proLabelId
)
{
this
.
proLabelId
=
proLabelId
;
}
public
Long
getDepLabelId
()
{
return
depLabelId
;
}
public
void
setDepLabelId
(
Long
depLabelId
)
{
this
.
depLabelId
=
depLabelId
;
}
public
Long
getPurLabelId
()
{
return
purLabelId
;
}
public
void
setPurLabelId
(
Long
purLabelId
)
{
this
.
purLabelId
=
purLabelId
;
}
public
String
getJoinTitle
()
{
return
joinTitle
;
}
public
void
setJoinTitle
(
String
joinTitle
)
{
this
.
joinTitle
=
joinTitle
;
}
public
String
getJoinSlogan
()
{
return
joinSlogan
;
}
public
void
setJoinSlogan
(
String
joinSlogan
)
{
this
.
joinSlogan
=
joinSlogan
;
}
public
String
getPersonalQrcodeUrl
()
{
return
personalQrcodeUrl
;
}
public
void
setPersonalQrcodeUrl
(
String
personalQrcodeUrl
)
{
this
.
personalQrcodeUrl
=
personalQrcodeUrl
;
}
public
Long
getProductId
()
{
return
productId
;
}
public
void
setProductId
(
Long
productId
)
{
this
.
productId
=
productId
;
}
public
Long
getCreateUser
()
{
return
createUser
;
}
public
void
setCreateUser
(
Long
createUser
)
{
this
.
createUser
=
createUser
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
Boolean
getIsDelete
()
{
return
isDelete
;
}
public
void
setIsDelete
(
Boolean
isDelete
)
{
this
.
isDelete
=
isDelete
;
}
@Override
public
String
toString
()
{
return
"BookGroup{"
+
"id="
+
id
+
", bookId="
+
bookId
+
", channelId="
+
channelId
+
", groupQrcodeUrl='"
+
groupQrcodeUrl
+
'\''
+
", groupQrcodeName='"
+
groupQrcodeName
+
'\''
+
", proLabelId="
+
proLabelId
+
", depLabelId="
+
depLabelId
+
", purLabelId="
+
purLabelId
+
", joinTitle='"
+
joinTitle
+
'\''
+
", joinSlogan='"
+
joinSlogan
+
'\''
+
", personalQrcodeUrl='"
+
personalQrcodeUrl
+
'\''
+
", productId="
+
productId
+
", createUser="
+
createUser
+
", createTime="
+
createTime
+
", updateTime="
+
updateTime
+
", isDelete="
+
isDelete
+
"} "
+
super
.
toString
();
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/group/facade/BookGroupFacade.java
0 → 100644
View file @
b9ec0883
package
com
.
pcloud
.
book
.
group
.
facade
;
import
org.codehaus.jackson.JsonParseException
;
import
org.springframework.cloud.netflix.feign.FeignClient
;
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
com.pcloud.book.group.entity.BookGroup
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.permission.PermissionException
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
/**
* Description 社群书群二维码接口
* Created by PENG on 2019/4/17.
*/
@FeignClient
(
value
=
"pcloud-service-book"
,
qualifier
=
"bookGroupFacadeCloud"
,
path
=
"bookGroup"
)
@Api
(
description
=
"社群书群二维码接口"
)
public
interface
BookGroupFacade
{
/**
* 获取社群书群二维码信息
* @param token 用户身份信息
* @param bookGroupId 群二维码ID
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation
(
value
=
"获取社群书群二维码信息"
,
httpMethod
=
"GET"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"token"
,
value
=
"用户身份信息"
,
dataType
=
"string"
,
paramType
=
"header"
),
@ApiImplicitParam
(
name
=
"bookGroupId"
,
value
=
"群二维码ID"
,
dataType
=
"long"
,
paramType
=
"query"
)
})
@RequestMapping
(
value
=
"getBookGroupInfo"
,
method
=
RequestMethod
.
GET
)
ResponseDto
<?>
getBookGroupInfo
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"bookGroupId"
,
required
=
false
)
Long
bookGroupId
)
throws
BizException
,
PermissionException
,
JsonParseException
;
/**
* 获取社群书群二维码信息
* @param token 用户身份信息
* @param bookId 书刊ID
* @param channelId 运营ID
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation
(
value
=
"获取社群书群二维码信息"
,
httpMethod
=
"GET"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"token"
,
value
=
"用户身份信息"
,
dataType
=
"string"
,
paramType
=
"header"
),
@ApiImplicitParam
(
name
=
"bookId"
,
value
=
"书刊ID"
,
dataType
=
"long"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"channelId"
,
value
=
"运营ID"
,
dataType
=
"long"
,
paramType
=
"query"
)
})
@RequestMapping
(
value
=
"getBookGroupInfoByBookId"
,
method
=
RequestMethod
.
GET
)
ResponseDto
<?>
getBookGroupInfoByBookId
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"bookId"
,
required
=
false
)
Long
bookId
,
@RequestParam
(
value
=
"channelId"
,
required
=
false
)
Long
channelId
)
throws
BizException
,
PermissionException
,
JsonParseException
;
/**
* 更新群二维码信息
* @param token 用户身份信息
* @param bookGroup 群二维码实体
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation
(
value
=
"更新群二维码信息"
,
httpMethod
=
"POST"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"token"
,
value
=
"用户身份信息"
,
dataType
=
"string"
,
paramType
=
"header"
),
@ApiImplicitParam
(
name
=
"bookGroup"
,
value
=
"群二维码实体"
,
dataType
=
"BookGroup"
,
paramType
=
"body"
)
})
@RequestMapping
(
value
=
"updateBookGroup"
,
method
=
RequestMethod
.
POST
)
ResponseDto
<?>
updateBookGroup
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
BookGroup
bookGroup
)
throws
BizException
,
PermissionException
,
JsonParseException
;
/**
* 根据社群码ID获取书名
* @param bookGroupId 社群码ID
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation
(
value
=
"根据社群码ID获取书名"
,
httpMethod
=
"GET"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"bookGroupId"
,
value
=
"社群码ID"
,
dataType
=
"long"
,
paramType
=
"query"
)
})
@RequestMapping
(
value
=
"getBookNameByBookGroupId"
,
method
=
RequestMethod
.
GET
)
ResponseDto
<?>
getBookNameByBookGroupId
(
@RequestParam
(
value
=
"bookGroupId"
,
required
=
false
)
Long
bookGroupId
)
throws
BizException
,
PermissionException
,
JsonParseException
;
}
pcloud-service-book/src/main/java/com/pcloud/book/group/facade/impl/BookGroupFacadeImpl.java
0 → 100644
View file @
b9ec0883
package
com
.
pcloud
.
book
.
group
.
facade
.
impl
;
import
org.codehaus.jackson.JsonParseException
;
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
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.group.biz.BookGroupBiz
;
import
com.pcloud.book.group.entity.BookGroup
;
import
com.pcloud.book.group.facade.BookGroupFacade
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.permission.PermissionException
;
import
com.pcloud.common.utils.SessionUtil
;
/**
* Description 社群书群二维码接口实现类
* Created by PENG on 2019/4/17.
*/
@RestController
(
"bookGroupFacade"
)
@RequestMapping
(
"bookGroup"
)
public
class
BookGroupFacadeImpl
implements
BookGroupFacade
{
@Autowired
private
BookGroupBiz
bookGroupBiz
;
/**
* 获取社群书群二维码信息
*/
@Override
@RequestMapping
(
value
=
"getBookGroupInfo"
,
method
=
RequestMethod
.
GET
)
public
ResponseDto
<?>
getBookGroupInfo
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"bookGroupId"
,
required
=
false
)
Long
bookGroupId
)
throws
BizException
,
PermissionException
,
JsonParseException
{
if
(
null
==
bookGroupId
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"参数有误!"
);
}
SessionUtil
.
getToken4Redis
(
token
);
return
new
ResponseDto
<>(
bookGroupBiz
.
getBookGroupInfo
(
bookGroupId
));
}
/**
* 获取社群书群二维码信息
*/
@Override
@RequestMapping
(
value
=
"getBookGroupInfoByBookId"
,
method
=
RequestMethod
.
GET
)
public
ResponseDto
<?>
getBookGroupInfoByBookId
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"bookId"
,
required
=
false
)
Long
bookId
,
@RequestParam
(
value
=
"channelId"
,
required
=
false
)
Long
channelId
)
throws
BizException
,
PermissionException
,
JsonParseException
{
if
(
null
==
bookId
||
null
==
channelId
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"参数有误!"
);
}
Long
adviserId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
return
new
ResponseDto
<>(
bookGroupBiz
.
getBookGroupInfoByBookId
(
bookId
,
channelId
,
adviserId
));
}
/**
* 更新群二维码信息
*/
@Override
@RequestMapping
(
value
=
"updateBookGroup"
,
method
=
RequestMethod
.
POST
)
public
ResponseDto
<?>
updateBookGroup
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
BookGroup
bookGroup
)
throws
BizException
,
PermissionException
,
JsonParseException
{
if
(
null
==
bookGroup
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"参数有误!"
);
}
bookGroupBiz
.
updateBookGroup
(
bookGroup
);
return
new
ResponseDto
<>();
}
/**
* 根据社群码ID获取书名
*/
@Override
@RequestMapping
(
value
=
"getBookNameByBookGroupId"
,
method
=
RequestMethod
.
GET
)
public
ResponseDto
<?>
getBookNameByBookGroupId
(
@RequestParam
(
value
=
"bookGroupId"
,
required
=
false
)
Long
bookGroupId
)
throws
BizException
,
PermissionException
,
JsonParseException
{
if
(
null
==
bookGroupId
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"参数有误!"
);
}
return
new
ResponseDto
<>(
bookGroupBiz
.
getBookNameByBookGroupId
(
bookGroupId
));
}
}
pcloud-service-book/src/main/resources/mapper/group/BookGroupMapper.xml
0 → 100644
View file @
b9ec0883
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.pcloud.book.group.dao.impl.BookGroupDaoImpl"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.group.entity.BookGroup"
>
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"book_id"
property=
"bookId"
jdbcType=
"BIGINT"
/>
<result
column=
"channel_id"
property=
"channelId"
jdbcType=
"BIGINT"
/>
<result
column=
"group_qrcode_url"
property=
"groupQrcodeUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"group_qrcode_name"
property=
"groupQrcodeName"
jdbcType=
"VARCHAR"
/>
<result
column=
"pro_label_id"
property=
"proLabelId"
jdbcType=
"BIGINT"
/>
<result
column=
"dep_label_id"
property=
"depLabelId"
jdbcType=
"BIGINT"
/>
<result
column=
"pur_label_id"
property=
"purLabelId"
jdbcType=
"BIGINT"
/>
<result
column=
"join_title"
property=
"joinTitle"
jdbcType=
"VARCHAR"
/>
<result
column=
"join_slogan"
property=
"joinSlogan"
jdbcType=
"VARCHAR"
/>
<result
column=
"personal_qrcode_url"
property=
"personalQrcodeUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"product_id"
property=
"productId"
jdbcType=
"BIGINT"
/>
<result
column=
"create_user"
property=
"createUser"
jdbcType=
"BIGINT"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"is_delete"
property=
"isDelete"
jdbcType=
"BIT"
/>
</resultMap>
<resultMap
id=
"BookGroupDTO"
type=
"com.pcloud.book.group.dto.BookGroupDTO"
>
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"book_id"
property=
"bookId"
jdbcType=
"BIGINT"
/>
<result
column=
"channel_id"
property=
"channelId"
jdbcType=
"BIGINT"
/>
<result
column=
"group_qrcode_url"
property=
"groupQrcodeUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"group_qrcode_name"
property=
"groupQrcodeName"
jdbcType=
"VARCHAR"
/>
<result
column=
"pro_label_id"
property=
"proLabelId"
jdbcType=
"BIGINT"
/>
<result
column=
"dep_label_id"
property=
"depLabelId"
jdbcType=
"BIGINT"
/>
<result
column=
"pur_label_id"
property=
"purLabelId"
jdbcType=
"BIGINT"
/>
<result
column=
"join_title"
property=
"joinTitle"
jdbcType=
"VARCHAR"
/>
<result
column=
"join_slogan"
property=
"joinSlogan"
jdbcType=
"VARCHAR"
/>
<result
column=
"personal_qrcode_url"
property=
"personalQrcodeUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"product_id"
property=
"productId"
jdbcType=
"BIGINT"
/>
<result
column=
"create_user"
property=
"createUser"
jdbcType=
"BIGINT"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"is_delete"
property=
"isDelete"
jdbcType=
"BIT"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, book_id, channel_id, group_qrcode_url, group_qrcode_name, pro_label_id, dep_label_id,
pur_label_id, join_title, join_slogan, personal_qrcode_url, product_id, create_user, create_time,
update_time, is_delete
</sql>
<select
id=
"getById"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Long"
>
select
<include
refid=
"Base_Column_List"
/>
from book_group
where id = #{id,jdbcType=BIGINT}
</select>
<select
id=
"getDTOById"
resultMap=
"BookGroupDTO"
parameterType=
"java.lang.Long"
>
select
<include
refid=
"Base_Column_List"
/>
from book_group
where id = #{id,jdbcType=BIGINT}
</select>
<select
id=
"getDTOByBookId"
resultMap=
"BookGroupDTO"
parameterType=
"map"
>
select
<include
refid=
"Base_Column_List"
/>
from book_group
where book_id = #{bookId,jdbcType=BIGINT}
and channel_id = #{channelId,jdbcType=BIGINT}
and create_user = #{adviserId,jdbcType=BIGINT}
</select>
<delete
id=
"deleteById"
parameterType=
"java.lang.Long"
>
update book_group set is_delete = 1
where id = #{id,jdbcType=BIGINT} and is_delete = 0
</delete>
<update
id=
"deleteByBookId"
parameterType=
"map"
>
update book_group set is_delete = 1
where book_id = #{bookId,jdbcType=BIGINT}
and channel_id = #{channelId,jdbcType=BIGINT}
and create_user = #{adviserId,jdbcType=BIGINT}
and is_delete = 0
</update>
<update
id=
"recoverByBookId"
parameterType=
"map"
>
update book_group set is_delete = 0
where book_id = #{bookId,jdbcType=BIGINT}
and channel_id = #{channelId,jdbcType=BIGINT}
and create_user = #{adviserId,jdbcType=BIGINT}
and is_delete = 1
</update>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.group.entity.BookGroup"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into book_group
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
book_id,
channel_id,
group_qrcode_url,
group_qrcode_name,
pro_label_id,
dep_label_id,
pur_label_id,
join_title,
join_slogan,
personal_qrcode_url,
product_id,
create_user,
create_time,
update_time,
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
#{bookId,jdbcType=BIGINT},
#{channelId,jdbcType=BIGINT},
#{groupQrcodeUrl,jdbcType=VARCHAR},
#{groupQrcodeName,jdbcType=VARCHAR},
#{proLabelId,jdbcType=BIGINT},
#{depLabelId,jdbcType=BIGINT},
#{purLabelId,jdbcType=BIGINT},
#{joinTitle,jdbcType=VARCHAR},
#{joinSlogan,jdbcType=VARCHAR},
#{personalQrcodeUrl,jdbcType=VARCHAR},
#{productId,jdbcType=BIGINT},
#{createUser,jdbcType=BIGINT},
NOW(),
NOW(),
</trim>
</insert>
<update
id=
"update"
parameterType=
"com.pcloud.book.group.entity.BookGroup"
>
update book_group
<set>
<if
test=
"bookId != null"
>
book_id = #{bookId,jdbcType=BIGINT},
</if>
<if
test=
"channelId != null"
>
channel_id = #{channelId,jdbcType=BIGINT},
</if>
<if
test=
"groupQrcodeUrl != null"
>
group_qrcode_url = #{groupQrcodeUrl,jdbcType=VARCHAR},
</if>
<if
test=
"groupQrcodeName != null"
>
group_qrcode_name = #{groupQrcodeName,jdbcType=VARCHAR},
</if>
<if
test=
"proLabelId != null"
>
pro_label_id = #{proLabelId,jdbcType=BIGINT},
</if>
<if
test=
"depLabelId != null"
>
dep_label_id = #{depLabelId,jdbcType=BIGINT},
</if>
<if
test=
"purLabelId != null"
>
pur_label_id = #{purLabelId,jdbcType=BIGINT},
</if>
<if
test=
"joinTitle != null"
>
join_title = #{joinTitle,jdbcType=VARCHAR},
</if>
<if
test=
"joinSlogan != null"
>
join_slogan = #{joinSlogan,jdbcType=VARCHAR},
</if>
<if
test=
"personalQrcodeUrl != null"
>
personal_qrcode_url = #{personalQrcodeUrl,jdbcType=VARCHAR},
</if>
<if
test=
"productId != null"
>
product_id = #{productId,jdbcType=BIGINT},
</if>
update_time = NOW(),
</set>
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
pom.xml
View file @
b9ec0883
...
@@ -117,6 +117,7 @@
...
@@ -117,6 +117,7 @@
<pcloud-facade-contentcenter.version>
2.1.0-SNAPSHOT
</pcloud-facade-contentcenter.version>
<pcloud-facade-contentcenter.version>
2.1.0-SNAPSHOT
</pcloud-facade-contentcenter.version>
<pcloud-facade-tradecenter.version>
2.1.0-RELEASE
</pcloud-facade-tradecenter.version>
<pcloud-facade-tradecenter.version>
2.1.0-RELEASE
</pcloud-facade-tradecenter.version>
<pcloud-facade-readercenter.version>
2.1.0-RELEASE
</pcloud-facade-readercenter.version>
<pcloud-facade-readercenter.version>
2.1.0-RELEASE
</pcloud-facade-readercenter.version>
<pcloud-facade-labelcenter.version>
2.1.0-RELEASE
</pcloud-facade-labelcenter.version>
</properties>
</properties>
<dependencyManagement>
<dependencyManagement>
...
...
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