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
0358c48d
Commit
0358c48d
authored
May 12, 2021
by
Administrator
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/1004635' into 'master'
feat: [1004635] 屏蔽书单 See merge request rays/pcloud-book!1300
parents
f9136971
01344203
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
539 additions
and
34 deletions
+539
-34
BookConstant.java
...main/java/com/pcloud/book/book/constant/BookConstant.java
+3
-0
AppletBookIgnorBiz.java
...n/java/com/pcloud/book/applet/biz/AppletBookIgnorBiz.java
+66
-0
AppletBookIgnorBizImpl.java
...m/pcloud/book/applet/biz/impl/AppletBookIgnorBizImpl.java
+136
-0
AppletBookIgnorDao.java
...n/java/com/pcloud/book/applet/dao/AppletBookIgnorDao.java
+19
-0
AppletBookIgnorDaoImpl.java
...m/pcloud/book/applet/dao/impl/AppletBookIgnorDaoImpl.java
+27
-0
AppletBookIgnor.java
...n/java/com/pcloud/book/applet/entity/AppletBookIgnor.java
+59
-0
AppletBookIgnorFacade.java
.../com/pcloud/book/applet/facade/AppletBookIgnorFacade.java
+90
-0
ESBookAndAdviserBizImpl.java
.../com/pcloud/book/es/biz/impl/ESBookAndAdviserBizImpl.java
+8
-4
UpdateSuperSearchProducer.java
...om/pcloud/book/mq/producer/UpdateSuperSearchProducer.java
+3
-30
AppletBookIgnor.Mapper.xml
...c/main/resources/mapper/applet/AppletBookIgnor.Mapper.xml
+128
-0
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/book/constant/BookConstant.java
View file @
0358c48d
...
...
@@ -446,4 +446,7 @@ public class BookConstant {
}
};
public
static
String
IGNOR_BOOK_KEY
=
CacheConstant
.
BOOK
+
"ignorBookKey"
;
}
pcloud-service-book/src/main/java/com/pcloud/book/applet/biz/AppletBookIgnorBiz.java
0 → 100644
View file @
0358c48d
package
com
.
pcloud
.
book
.
applet
.
biz
;
import
com.pcloud.book.applet.entity.AppletBookIgnor
;
import
com.pcloud.common.page.PageBeanNew
;
import
java.util.List
;
/**
* (AppletBookIgnor)表服务接口
*
* @author makejava
* @since 2021-05-06 13:49:59
*/
public
interface
AppletBookIgnorBiz
{
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
AppletBookIgnor
getById
(
Long
id
);
/**
* 分页查询
*/
PageBeanNew
getList
(
Integer
currentPage
,
Integer
numPerPage
);
/**
* 新增数据
*
* @param appletBookIgnor 实例对象
* @return 主键
*/
Long
insert
(
AppletBookIgnor
appletBookIgnor
);
/**
* 修改数据
*
* @param appletBookIgnor 实例对象
*/
void
update
(
AppletBookIgnor
appletBookIgnor
);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
void
deleteById
(
Long
id
);
/**
* 通过主键软删除数据
*
* @param id 主键
* @return 是否成功
*/
void
softDeleteById
(
Long
id
);
/**
* 获取所有书籍
* @return
*/
List
<
Long
>
getAllIgnorBookIds
();
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/biz/impl/AppletBookIgnorBizImpl.java
0 → 100644
View file @
0358c48d
package
com
.
pcloud
.
book
.
applet
.
biz
.
impl
;
import
com.pcloud.book.applet.biz.AppletBookIgnorBiz
;
import
com.pcloud.book.applet.dao.AppletBookIgnorDao
;
import
com.pcloud.book.applet.entity.AppletBookIgnor
;
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.rightsSetting.entity.RightsSettingBookRelation
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.NumberUtil
;
import
com.pcloud.common.utils.cache.redis.JedisClusterUtils
;
import
com.pcloud.usercenter.party.adviser.dto.AdviserBaseInfoDto
;
import
org.apache.commons.collections.MapUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
static
com
.
pcloud
.
book
.
book
.
constant
.
BookConstant
.
IGNOR_BOOK_KEY
;
/**
* (AppletBookIgnor)表服务实现类
*
* @author makejava
* @since 2021-05-06 13:49:59
*/
@Service
(
"appletBookIgnorBiz"
)
public
class
AppletBookIgnorBizImpl
implements
AppletBookIgnorBiz
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
AppletBookIgnorBizImpl
.
class
);
@Autowired
private
AppletBookIgnorDao
appletBookIgnorDao
;
@Autowired
private
AdviserConsr
adviserConsr
;
@Autowired
private
BookBiz
bookBiz
;
@Override
@ParamLog
(
"通过ID查询单条数据"
)
public
AppletBookIgnor
getById
(
Long
id
)
{
return
appletBookIgnorDao
.
getById
(
id
);
}
@Override
@ParamLog
(
"查询多条数据"
)
public
PageBeanNew
getList
(
Integer
currentPage
,
Integer
numPerPage
)
{
PageBeanNew
pageBeanNew
=
appletBookIgnorDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
null
,
"getList"
);
List
recordList
=
pageBeanNew
.
getRecordList
();
if
(
ListUtils
.
isEmpty
(
recordList
))
{
return
pageBeanNew
;
}
// 加载其它数据
fillBookInfo
(
recordList
);
return
pageBeanNew
;
}
private
void
fillBookInfo
(
List
<
AppletBookIgnor
>
recordList
)
{
List
<
Long
>
bookIds
=
recordList
.
stream
().
map
(
e
->
e
.
getBookId
()).
collect
(
Collectors
.
toList
());
List
<
Long
>
adviserIds
=
recordList
.
stream
().
map
(
e
->
e
.
getAdviserId
()).
collect
(
Collectors
.
toList
());
Map
<
Long
,
AdviserBaseInfoDto
>
infoDtoMap
=
adviserConsr
.
getAdviserId2AdviserInfoDtoMap
(
adviserIds
);
Map
<
Long
,
BookDto
>
bookDtoMap
=
bookBiz
.
getListByIds
(
bookIds
);
if
(
MapUtils
.
isEmpty
(
bookDtoMap
))
{
return
;
}
for
(
AppletBookIgnor
appletBookIgnor:
recordList
)
{
if
(
bookDtoMap
.
containsKey
(
appletBookIgnor
.
getBookId
())
&&
null
!=
bookDtoMap
.
get
(
appletBookIgnor
.
getBookId
()))
{
appletBookIgnor
.
setBookName
(
bookDtoMap
.
get
(
appletBookIgnor
.
getBookId
()).
getBookName
());
appletBookIgnor
.
setIsbn
(
bookDtoMap
.
get
(
appletBookIgnor
.
getBookId
()).
getIsbn
());
appletBookIgnor
.
setCoverImg
(
bookDtoMap
.
get
(
appletBookIgnor
.
getBookId
()).
getCoverImg
());
}
if
(
MapUtils
.
isNotEmpty
(
infoDtoMap
)
&&
null
!=
infoDtoMap
.
get
(
appletBookIgnor
.
getAdviserId
()))
{
if
(
null
!=
infoDtoMap
.
get
(
appletBookIgnor
.
getAdviserId
()))
{
appletBookIgnor
.
setAdviserName
(
infoDtoMap
.
get
(
appletBookIgnor
.
getAdviserId
()).
getPartyName
());
appletBookIgnor
.
setAgentName
(
infoDtoMap
.
get
(
appletBookIgnor
.
getAdviserId
()).
getAgentName
());
}
}
}
}
@Override
@ParamLog
(
"新增"
)
public
Long
insert
(
AppletBookIgnor
appletBookIgnor
)
{
if
(
null
==
appletBookIgnor
||
null
==
appletBookIgnor
.
getBookId
())
{
throw
new
BizException
(
BizException
.
PARAM_IS_NULL
.
getCode
(),
"书籍id为空"
);
}
List
<
Long
>
allIgnorBookIds
=
appletBookIgnorDao
.
getAllIgnorBookIds
();
if
(!
ListUtils
.
isEmpty
(
allIgnorBookIds
)
&&
allIgnorBookIds
.
contains
(
appletBookIgnor
.
getBookId
()))
{
throw
new
BizException
(
BizException
.
PARAM_IS_NULL
.
getCode
(),
"请勿重复添加书籍"
);
}
JedisClusterUtils
.
del
(
IGNOR_BOOK_KEY
);
appletBookIgnorDao
.
insert
(
appletBookIgnor
);
return
appletBookIgnor
.
getId
();
}
@Override
@ParamLog
(
"修改"
)
public
void
update
(
AppletBookIgnor
appletBookIgnor
)
{
if
(
appletBookIgnor
==
null
||
!
NumberUtil
.
isNumber
(
appletBookIgnor
.
getId
()))
{
throw
BizException
.
PARAM_IS_NULL
;
}
JedisClusterUtils
.
del
(
IGNOR_BOOK_KEY
);
appletBookIgnorDao
.
update
(
appletBookIgnor
);
}
@Override
@ParamLog
(
"删除"
)
public
void
deleteById
(
Long
id
)
{
appletBookIgnorDao
.
deleteById
(
id
);
}
@Override
@ParamLog
(
"软删除"
)
public
void
softDeleteById
(
Long
id
)
{
JedisClusterUtils
.
del
(
IGNOR_BOOK_KEY
);
appletBookIgnorDao
.
softDeleteById
(
id
);
}
@Override
@ParamLog
(
"获取所有被屏蔽的书籍ids"
)
public
List
<
Long
>
getAllIgnorBookIds
()
{
List
<
Long
>
ignorBookIds
=
appletBookIgnorDao
.
getAllIgnorBookIds
();
return
ListUtils
.
isEmpty
(
ignorBookIds
)
?
new
ArrayList
<>()
:
ignorBookIds
;
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/dao/AppletBookIgnorDao.java
0 → 100644
View file @
0358c48d
package
com
.
pcloud
.
book
.
applet
.
dao
;
import
com.pcloud.book.applet.entity.AppletBookIgnor
;
import
com.pcloud.common.core.dao.BaseDao
;
import
java.util.List
;
/**
* (AppletBookIgnor)表数据库访问层
*
* @author makejava
* @since 2021-05-06 13:49:59
*/
public
interface
AppletBookIgnorDao
extends
BaseDao
<
AppletBookIgnor
>
{
int
softDeleteById
(
Long
id
);
List
<
Long
>
getAllIgnorBookIds
();
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/dao/impl/AppletBookIgnorDaoImpl.java
0 → 100644
View file @
0358c48d
package
com
.
pcloud
.
book
.
applet
.
dao
.
impl
;
import
com.pcloud.book.applet.dao.AppletBookIgnorDao
;
import
com.pcloud.book.applet.entity.AppletBookIgnor
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
/**
* (AppletBookIgnor)表数据库访问层
*
* @author makejava
* @since 2021-05-06 13:49:59
*/
@Repository
(
"appletBookIgnorDaoImpl"
)
public
class
AppletBookIgnorDaoImpl
extends
BaseDaoImpl
<
AppletBookIgnor
>
implements
AppletBookIgnorDao
{
public
int
softDeleteById
(
Long
id
)
{
return
getSessionTemplate
().
update
(
getStatement
(
"softDeleteById"
),
id
);
}
@Override
public
List
<
Long
>
getAllIgnorBookIds
()
{
return
getSessionTemplate
().
selectList
(
getStatement
(
"getAllIgnorBookIds"
));
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/entity/AppletBookIgnor.java
0 → 100644
View file @
0358c48d
package
com
.
pcloud
.
book
.
applet
.
entity
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.pcloud.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
/**
* (AppletBookIgnor)实体类
*
* @author makejava
* @since 2021-05-06 13:49:58
*/
@Data
public
class
AppletBookIgnor
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
410246221902136605L
;
@ApiModelProperty
(
"主键ID"
)
private
Long
id
;
@ApiModelProperty
(
"书籍id"
)
private
Long
bookId
;
@ApiModelProperty
(
"渠道id"
)
private
Long
channelId
;
@ApiModelProperty
(
"编辑id"
)
private
Long
adviserId
;
@ApiModelProperty
(
"bookAdviserId"
)
private
Long
bookAdviserId
;
@ApiModelProperty
(
"创建时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
createTime
;
@ApiModelProperty
(
"更新时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
updateTime
;
@ApiModelProperty
(
"是否删除"
)
private
Integer
isDelete
;
private
String
bookName
;
private
String
adviserName
;
private
String
isbn
;
private
Long
agentId
;
private
String
agentName
;
private
String
coverImg
;
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/facade/AppletBookIgnorFacade.java
0 → 100644
View file @
0358c48d
package
com
.
pcloud
.
book
.
applet
.
facade
;
import
com.pcloud.book.applet.biz.AppletBookIgnorBiz
;
import
com.pcloud.book.applet.entity.AppletBookIgnor
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.permission.PermissionException
;
import
com.pcloud.common.utils.SessionUtil
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
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.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* (AppletBookIgnor)表控制层
*
* @author makejava
* @since 2021-05-06 13:49:59
*/
@RestController
(
"appletBookIgnorFacade"
)
@RequestMapping
(
"appletBookIgnor"
)
public
class
AppletBookIgnorFacade
{
@Autowired
private
AppletBookIgnorBiz
appletBookIgnorBiz
;
@ApiOperation
(
"通过主键查询单条数据"
)
@GetMapping
(
"getById"
)
public
ResponseDto
<?>
getById
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
Long
id
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
return
new
ResponseDto
<>(
appletBookIgnorBiz
.
getById
(
id
));
}
@ApiOperation
(
"分页查询"
)
@GetMapping
(
"getList"
)
public
ResponseDto
<?>
getList
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"currentPage"
,
defaultValue
=
"0"
)
Integer
currentPage
,
@RequestParam
(
value
=
"numPerPage"
,
defaultValue
=
"10"
)
Integer
numPerPage
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
return
new
ResponseDto
<>(
appletBookIgnorBiz
.
getList
(
currentPage
,
numPerPage
));
}
@ApiOperation
(
"新增"
)
@PostMapping
(
"insert"
)
public
ResponseDto
<?>
insert
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
AppletBookIgnor
appletBookIgnor
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
return
new
ResponseDto
<>(
appletBookIgnorBiz
.
insert
(
appletBookIgnor
));
}
@ApiOperation
(
"更新"
)
@PostMapping
(
"update"
)
public
ResponseDto
<?>
update
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
AppletBookIgnor
appletBookIgnor
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
appletBookIgnorBiz
.
update
(
appletBookIgnor
);
return
new
ResponseDto
<>();
}
@ApiOperation
(
"删除"
)
@GetMapping
(
"deleteById"
)
public
ResponseDto
<?>
deleteById
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
Long
id
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
if
(
null
==
id
)
{
throw
BookBizException
.
PARAM_DELETION
;
}
appletBookIgnorBiz
.
deleteById
(
id
);
return
new
ResponseDto
<>();
}
@ApiOperation
(
"软删除"
)
@GetMapping
(
"softDeleteById"
)
public
ResponseDto
<?>
softDeleteById
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
Long
id
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
if
(
null
==
id
)
{
throw
BookBizException
.
PARAM_DELETION
;
}
appletBookIgnorBiz
.
softDeleteById
(
id
);
return
new
ResponseDto
<>();
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/es/biz/impl/ESBookAndAdviserBizImpl.java
View file @
0358c48d
...
...
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
import
cn.hutool.core.map.MapUtil
;
import
com.google.common.collect.Lists
;
import
com.pcloud.analysisengine.browse.dto.BrowseCacheRecordDto
;
import
com.pcloud.book.applet.biz.AppletBookIgnorBiz
;
import
com.pcloud.book.applet.biz.AppletUserBookcaseBiz
;
import
com.pcloud.book.book.biz.BookBiz
;
import
com.pcloud.book.book.constant.BookConstant
;
...
...
@@ -65,6 +66,8 @@ import java.util.Objects;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
static
com
.
pcloud
.
book
.
book
.
constant
.
BookConstant
.
IGNOR_BOOK_KEY
;
/**
* @Description
* @Author ruansiyuan
...
...
@@ -101,6 +104,8 @@ public class ESBookAndAdviserBizImpl implements ESBookAndAdviserBiz {
private
BookBiz
bookBiz
;
@Autowired
private
BookAdviserDao
bookAdviserDao
;
@Autowired
private
AppletBookIgnorBiz
appletBookIgnorBiz
;
@ParamLog
(
"导入全部book和bookAdviser"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
...
@@ -442,11 +447,10 @@ public class ESBookAndAdviserBizImpl implements ESBookAndAdviserBiz {
}
private
BoolQueryBuilder
getBookBuilder
()
{
String
ignorBookKey
=
CacheConstant
.
BOOK
+
"ignorBookKey"
;
List
<
Long
>
bookIds
=
JedisClusterUtils
.
getJsonList
(
ignorBookKey
,
Long
.
class
);
List
<
Long
>
bookIds
=
JedisClusterUtils
.
getJsonList
(
IGNOR_BOOK_KEY
,
Long
.
class
);
if
(
ListUtils
.
isEmpty
(
bookIds
))
{
bookIds
=
Lists
.
newArrayList
(
5920573L
,
5934953L
,
5920574L
,
5934954L
);
JedisClusterUtils
.
setJsonList
(
ignorBookKey
,
bookIds
,
3600
*
24
);
bookIds
=
appletBookIgnorBiz
.
getAllIgnorBookIds
(
);
JedisClusterUtils
.
setJsonList
(
IGNOR_BOOK_KEY
,
bookIds
,
3600
*
24
);
}
BoolQueryBuilder
mustNot
=
QueryBuilders
.
boolQuery
().
mustNot
(
QueryBuilders
.
termsQuery
(
"bookId"
,
bookIds
));
return
mustNot
;
...
...
pcloud-service-book/src/main/java/com/pcloud/book/mq/producer/UpdateSuperSearchProducer.java
View file @
0358c48d
...
...
@@ -69,44 +69,17 @@ public class UpdateSuperSearchProducer {
}
public
void
create
(
Long
id
)
{
//二维码迁至渠道,渠道已更新,此处不再次处理
log
.
info
(
"编辑创建新增超级搜索数据:{}"
,
id
);
if
(
null
==
id
)
{
return
;
}
ThreadPoolUtils
.
UPDATE_SUPER_SEARCH_POOL
.
execute
(()
->
{
UpdateSuperSearchMQDTO
updateSuperSearchMQDTO
=
UpdateSuperSearchMQDTO
.
builder
()
.
superSearchCode
(
UpdateSuperSearchCode
.
GROUP_QRCODE_CREATE
)
.
resourceId
(
id
)
.
build
();
updateSuperSearchQueueBiz
.
sendMessageQueue
(
updateSuperSearchMQDTO
);
});
}
public
void
delete
(
Long
id
)
{
//二维码迁至渠道,渠道已更新,此处不再次处理
log
.
info
(
"编辑删除新增超级搜索数据sceneId:{}"
,
id
);
if
(
null
==
id
)
{
return
;
}
ThreadPoolUtils
.
UPDATE_SUPER_SEARCH_POOL
.
execute
(()
->
{
UpdateSuperSearchMQDTO
updateSuperSearchMQDTO
=
UpdateSuperSearchMQDTO
.
builder
()
.
superSearchCode
(
UpdateSuperSearchCode
.
GROUP_QRCODE_DELETE
)
.
resourceId
(
id
)
.
build
();
updateSuperSearchQueueBiz
.
sendMessageQueue
(
updateSuperSearchMQDTO
);
});
}
public
void
update
(
Long
id
)
{
//二维码迁至渠道,渠道已更新,此处不再次处理
log
.
info
(
"编辑更新新增超级搜索数据:{} "
,
id
);
ThreadPoolUtils
.
UPDATE_SUPER_SEARCH_POOL
.
execute
(()
->
{
if
(
null
==
id
)
{
return
;
}
UpdateSuperSearchMQDTO
updateSuperSearchMQDTO
=
UpdateSuperSearchMQDTO
.
builder
()
.
superSearchCode
(
UpdateSuperSearchCode
.
GROUP_QRCODE_UPDATE
)
.
resourceId
(
id
)
.
build
();
updateSuperSearchQueueBiz
.
sendMessageQueue
(
updateSuperSearchMQDTO
);
});
}
}
pcloud-service-book/src/main/resources/mapper/applet/AppletBookIgnor.Mapper.xml
0 → 100644
View file @
0358c48d
<?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.applet.dao.impl.AppletBookIgnorDaoImpl"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.applet.entity.AppletBookIgnor"
>
<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=
"adviser_id"
property=
"adviserId"
jdbcType=
"BIGINT"
/>
<result
column=
"book_adviser_id"
property=
"bookAdviserId"
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=
"INTEGER"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, book_id, channel_id, adviser_id, book_adviser_id, create_time, update_time, is_delete
</sql>
<select
id=
"getById"
resultMap=
"BaseResultMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM applet_book_ignor
WHERE id = #{id}
</select>
<select
id=
"getList"
resultMap=
"BaseResultMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM applet_book_ignor
where is_delete = 0
order by create_time desc
</select>
<insert
id=
"insert"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
INSERT INTO applet_book_ignor(
book_id,
channel_id,
adviser_id,
book_adviser_id,
create_time,
update_time,
is_delete
) VALUES (
#{bookId, jdbcType=BIGINT},
#{channelId, jdbcType=BIGINT},
#{adviserId, jdbcType=BIGINT},
#{bookAdviserId, jdbcType=BIGINT},
now(),
now(),
0
)
</insert>
<insert
id=
"batchInsert"
>
INSERT INTO applet_book_ignor (
book_id,
channel_id,
adviser_id,
book_adviser_id,
create_time,
update_time,
is_delete
) VALUES
<foreach
collection=
"list"
item=
"item"
separator=
","
>
(
#{item.bookId, jdbcType=BIGINT},
#{item.channelId, jdbcType=BIGINT},
#{item.adviserId, jdbcType=BIGINT},
#{item.bookAdviserId, jdbcType=BIGINT},
#{item.createTime, jdbcType=TIMESTAMP},
#{item.updateTime, jdbcType=TIMESTAMP},
#{item.isDelete, jdbcType=INTEGER}
)
</foreach>
</insert>
<!--通过主键修改数据-->
<update
id=
"update"
>
UPDATE applet_book_ignor
<set>
<if
test=
"bookId != null"
>
book_id = #{bookId},
</if>
<if
test=
"channelId != null"
>
channel_id = #{channelId},
</if>
<if
test=
"adviserId != null"
>
adviser_id = #{adviserId},
</if>
<if
test=
"bookAdviserId != null"
>
book_adviser_id = #{bookAdviserId},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime},
</if>
<if
test=
"isDelete != null"
>
is_delete = #{isDelete},
</if>
</set>
WHERE id = #{id}
</update>
<!--通过主键删除-->
<delete
id=
"deleteById"
>
DELETE FROM applet_book_ignor where id = #{id}
</delete>
<!--通过主键软删除-->
<delete
id=
"softDeleteById"
>
update applet_book_ignor set is_delete = 1, update_time = now() where id = #{id}
</delete>
<select
id=
"getAllIgnorBookIds"
resultType=
"long"
>
select
distinct book_id
from
applet_book_ignor
where
is_delete = 0
</select>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment