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
86f2474b
Commit
86f2474b
authored
Sep 26, 2021
by
田超
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/1005527' into 'master'
feat:[1005527]关注公众号延时推送 See merge request rays/pcloud-book!1419
parents
ba1fe81a
b6f5631f
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
65 additions
and
10 deletions
+65
-10
BookGroupService.java
.../java/com/pcloud/book/group/service/BookGroupService.java
+6
-0
ResourcePageBiz.java
.../main/java/com/pcloud/book/group/biz/ResourcePageBiz.java
+8
-0
ResourcePageBizImpl.java
...a/com/pcloud/book/group/biz/impl/ResourcePageBizImpl.java
+39
-10
BookGroupServiceImpl.java
.../pcloud/book/group/service/impl/BookGroupServiceImpl.java
+8
-0
ThreadPoolUtils.java
...ain/java/com/pcloud/book/util/common/ThreadPoolUtils.java
+4
-0
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/group/service/BookGroupService.java
View file @
86f2474b
...
@@ -291,4 +291,10 @@ public interface BookGroupService {
...
@@ -291,4 +291,10 @@ public interface BookGroupService {
@ApiOperation
(
"查询栏目配置的rays工具类型"
)
@ApiOperation
(
"查询栏目配置的rays工具类型"
)
@GetMapping
(
"getConfiguredRaysAppTypeCode"
)
@GetMapping
(
"getConfiguredRaysAppTypeCode"
)
ResponseEntity
<
ResponseDto
<
List
<
String
>>>
getConfiguredRaysAppTypeCode
(
@RequestParam
(
"resourcePageColumnId"
)
Long
resourcePageColumnId
);
ResponseEntity
<
ResponseDto
<
List
<
String
>>>
getConfiguredRaysAppTypeCode
(
@RequestParam
(
"resourcePageColumnId"
)
Long
resourcePageColumnId
);
@ApiOperation
(
"书刊是否是小学段"
)
@GetMapping
(
"checkBookChildGrade"
)
ResponseEntity
<
ResponseDto
<
Boolean
>>
checkBookChildGrade
(
@RequestParam
(
"bookId"
)
Long
bookId
,
@RequestParam
(
"adviserId"
)
Long
adviserId
,
@RequestParam
(
"channelId"
)
Long
channelId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/ResourcePageBiz.java
View file @
86f2474b
...
@@ -464,4 +464,12 @@ public interface ResourcePageBiz {
...
@@ -464,4 +464,12 @@ public interface ResourcePageBiz {
* * @param null
* * @param null
*/
*/
List
<
String
>
getConfiguredRaysAppTypeCode
(
Long
resourcePageColumnId
);
List
<
String
>
getConfiguredRaysAppTypeCode
(
Long
resourcePageColumnId
);
/**
* 书刊是否是小学段
* @author:zhuyajie
* @date:2021/9/26 14:39
* * @param null
*/
Boolean
checkBookChildGrade
(
Long
bookId
,
Long
adviserId
,
Long
channelId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/ResourcePageBizImpl.java
View file @
86f2474b
...
@@ -21,7 +21,9 @@ import com.pcloud.book.applet.dto.AppletOuterBooklistDTO;
...
@@ -21,7 +21,9 @@ import com.pcloud.book.applet.dto.AppletOuterBooklistDTO;
import
com.pcloud.book.applet.dto.GroupActivity4AppletDTO
;
import
com.pcloud.book.applet.dto.GroupActivity4AppletDTO
;
import
com.pcloud.book.applet.entity.AppletThirdResources
;
import
com.pcloud.book.applet.entity.AppletThirdResources
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.book.biz.BookAdviserBiz
;
import
com.pcloud.book.book.biz.BookBiz
;
import
com.pcloud.book.book.biz.BookBiz
;
import
com.pcloud.book.book.dto.BookAdviserDto
;
import
com.pcloud.book.book.dto.BookDto
;
import
com.pcloud.book.book.dto.BookDto
;
import
com.pcloud.book.book.dto.RaysSceneCatalogDto
;
import
com.pcloud.book.book.dto.RaysSceneCatalogDto
;
import
com.pcloud.book.book.entity.Book
;
import
com.pcloud.book.book.entity.Book
;
...
@@ -178,6 +180,8 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
...
@@ -178,6 +180,8 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
private
ResourcePagePicDao
resourcePagePicDao
;
private
ResourcePagePicDao
resourcePagePicDao
;
@Autowired
@Autowired
private
TradeConsr
tradeConsr
;
private
TradeConsr
tradeConsr
;
@Autowired
private
BookAdviserBiz
bookAdviserBiz
;
@Value
(
"${nft.book}"
)
@Value
(
"${nft.book}"
)
private
List
<
Long
>
nftBookId
;
private
List
<
Long
>
nftBookId
;
...
@@ -432,7 +436,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
...
@@ -432,7 +436,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
if
(!
ListUtils
.
isEmpty
(
productIds4Shelve
)){
if
(!
ListUtils
.
isEmpty
(
productIds4Shelve
)){
//作品自动上架
//作品自动上架
List
<
Long
>
productIds
=
productIds4Shelve
;
List
<
Long
>
productIds
=
productIds4Shelve
;
ThreadPoolUtils
.
OTHER
_POOL
.
execute
(()->{
ThreadPoolUtils
.
RESOURCE
_POOL
.
execute
(()->{
Long
channelId
=
updateResourceColumnVO
.
getChannelId
();
Long
channelId
=
updateResourceColumnVO
.
getChannelId
();
if
(
null
==
channelId
)
{
if
(
null
==
channelId
)
{
channelId
=
getChannelIdFromUrl
(
updateResourceColumnVO
.
getItemVOList
().
get
(
0
).
getLinkUrl
());
channelId
=
getChannelIdFromUrl
(
updateResourceColumnVO
.
getItemVOList
().
get
(
0
).
getLinkUrl
());
...
@@ -1060,13 +1064,13 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
...
@@ -1060,13 +1064,13 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
Map
<
Long
,
AppDto
>
appDtoMap
=
new
HashMap
<>();
Map
<
Long
,
AppDto
>
appDtoMap
=
new
HashMap
<>();
Map
<
Long
,
ProductDto
>
productDtoMap
=
new
HashMap
<>();
Map
<
Long
,
ProductDto
>
productDtoMap
=
new
HashMap
<>();
Map
<
Long
,
MapBaseStatusDTO
>
appPriceMap
=
new
HashMap
<>();
Map
<
Long
,
MapBaseStatusDTO
>
appPriceMap
=
new
HashMap
<>();
Future
<
Map
<
Long
,
AppDto
>>
appMapSubmit
=
ThreadPoolUtils
.
OTHER
_POOL
.
submit
(()
->{
Future
<
Map
<
Long
,
AppDto
>>
appMapSubmit
=
ThreadPoolUtils
.
RESOURCE
_POOL
.
submit
(()
->{
return
appConsr
.
mapBaseByIds
(
appIds
);
return
appConsr
.
mapBaseByIds
(
appIds
);
});
});
Future
<
Map
<
Long
,
ProductDto
>>
productMapSubmit
=
ThreadPoolUtils
.
OTHER
_POOL
.
submit
(()
->{
Future
<
Map
<
Long
,
ProductDto
>>
productMapSubmit
=
ThreadPoolUtils
.
RESOURCE
_POOL
.
submit
(()
->{
return
productConsr
.
getProBasesByIds
(
productIds
);
return
productConsr
.
getProBasesByIds
(
productIds
);
});
});
Future
<
Map
<
Long
,
MapBaseStatusDTO
>>
appPriceMapSubmit
=
ThreadPoolUtils
.
OTHER
_POOL
.
submit
(()
->{
Future
<
Map
<
Long
,
MapBaseStatusDTO
>>
appPriceMapSubmit
=
ThreadPoolUtils
.
RESOURCE
_POOL
.
submit
(()
->{
return
appConsr
.
mapBaseStatusById
(
appIds
);
return
appConsr
.
mapBaseStatusById
(
appIds
);
});
});
try
{
try
{
...
@@ -1094,10 +1098,10 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
...
@@ -1094,10 +1098,10 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
Map
<
Long
,
Boolean
>
courseBuyStateMap
=
new
HashMap
<>();
Map
<
Long
,
Boolean
>
courseBuyStateMap
=
new
HashMap
<>();
if
(
null
!=
wechatUserId
)
{
if
(
null
!=
wechatUserId
)
{
appOfficialAccountToolMap
=
appConsr
.
getPayOfficialAccountsToolByAppIds
(
appIds
);
appOfficialAccountToolMap
=
appConsr
.
getPayOfficialAccountsToolByAppIds
(
appIds
);
Future
<
Map
<
Long
,
Boolean
>>
buyStateSubmit
=
ThreadPoolUtils
.
OTHER
_POOL
.
submit
(()
->{
Future
<
Map
<
Long
,
Boolean
>>
buyStateSubmit
=
ThreadPoolUtils
.
RESOURCE
_POOL
.
submit
(()
->{
return
tradeConsr
.
mapAppProductBuyState
(
wechatUserId
,
appIds
,
nonCourseProductIds
);
return
tradeConsr
.
mapAppProductBuyState
(
wechatUserId
,
appIds
,
nonCourseProductIds
);
});
});
Future
<
Map
<
Long
,
Boolean
>>
courseBuyStateSubmit
=
ThreadPoolUtils
.
OTHER
_POOL
.
submit
(()
->{
Future
<
Map
<
Long
,
Boolean
>>
courseBuyStateSubmit
=
ThreadPoolUtils
.
RESOURCE
_POOL
.
submit
(()
->{
return
tradeConsr
.
mapCourseProductBuyState
(
wechatUserId
,
courseProductIds
);
return
tradeConsr
.
mapCourseProductBuyState
(
wechatUserId
,
courseProductIds
);
});
});
try
{
try
{
...
@@ -1368,7 +1372,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
...
@@ -1368,7 +1372,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
// 修改该单页面的更新时间
// 修改该单页面的更新时间
resourcePageDao
.
updatePageUpdateTime
(
resourcePageId
);
resourcePageDao
.
updatePageUpdateTime
(
resourcePageId
);
//同步RAYS码资源配置
//同步RAYS码资源配置
ThreadPoolUtils
.
OTHER
_POOL
.
execute
(()->{
ThreadPoolUtils
.
RESOURCE
_POOL
.
execute
(()->{
ResourcePage
resourcePage
=
resourcePageDao
.
getById
(
resourcePageId
);
ResourcePage
resourcePage
=
resourcePageDao
.
getById
(
resourcePageId
);
this
.
updateOwnMessage4Qr
(
null
==
resourcePage
?
null
:
resourcePage
.
getSceneId
());
this
.
updateOwnMessage4Qr
(
null
==
resourcePage
?
null
:
resourcePage
.
getSceneId
());
});
});
...
@@ -1388,7 +1392,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
...
@@ -1388,7 +1392,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
//栏目重新排序
//栏目重新排序
this
.
updateSeq4Batch
(
column
.
getResourcePageId
(),
column
.
getNavigationId
());
this
.
updateSeq4Batch
(
column
.
getResourcePageId
(),
column
.
getNavigationId
());
//同步RAYS码资源配置
//同步RAYS码资源配置
ThreadPoolUtils
.
OTHER
_POOL
.
execute
(()->{
ThreadPoolUtils
.
RESOURCE
_POOL
.
execute
(()->{
ResourcePage
resourcePage
=
resourcePageDao
.
getPageByColumnId
(
resourcePageColumnId
);
ResourcePage
resourcePage
=
resourcePageDao
.
getPageByColumnId
(
resourcePageColumnId
);
this
.
updateOwnMessage4Qr
(
null
==
resourcePage
?
null
:
resourcePage
.
getSceneId
());
this
.
updateOwnMessage4Qr
(
null
==
resourcePage
?
null
:
resourcePage
.
getSceneId
());
});
});
...
@@ -1475,7 +1479,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
...
@@ -1475,7 +1479,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
page
.
getBookGroupId
()
==
null
?
page
.
getSceneId
()
:
page
.
getBookGroupId
(),
page
.
getBookGroupId
()
==
null
?
page
.
getSceneId
()
:
page
.
getBookGroupId
(),
AdviserTaskConstants
.
OperateTypeEnum
.
CONFIGURE_RESOURCE
.
getValue
());
AdviserTaskConstants
.
OperateTypeEnum
.
CONFIGURE_RESOURCE
.
getValue
());
//同步RAYS码资源配置
//同步RAYS码资源配置
ThreadPoolUtils
.
OTHER
_POOL
.
execute
(()->{
ThreadPoolUtils
.
RESOURCE
_POOL
.
execute
(()->{
this
.
updateOwnMessage4Qr
(
updateResourcePageVO
.
getSceneId
());
this
.
updateOwnMessage4Qr
(
updateResourcePageVO
.
getSceneId
());
});
});
return
resourcePageId
;
return
resourcePageId
;
...
@@ -2526,7 +2530,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
...
@@ -2526,7 +2530,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
this
.
deleteNavigation
(
navigationId
);
this
.
deleteNavigation
(
navigationId
);
}
}
//同步RAYS码资源配置
//同步RAYS码资源配置
ThreadPoolUtils
.
OTHER
_POOL
.
execute
(()
->
{
ThreadPoolUtils
.
RESOURCE
_POOL
.
execute
(()
->
{
ResourcePage
resourcePage
=
resourcePageDao
.
getById
(
navigationParamDTO
.
getResourcePageId
());
ResourcePage
resourcePage
=
resourcePageDao
.
getById
(
navigationParamDTO
.
getResourcePageId
());
this
.
updateOwnMessage4Qr
(
null
==
resourcePage
?
null
:
resourcePage
.
getSceneId
());
this
.
updateOwnMessage4Qr
(
null
==
resourcePage
?
null
:
resourcePage
.
getSceneId
());
});
});
...
@@ -2692,4 +2696,29 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
...
@@ -2692,4 +2696,29 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
public
List
<
String
>
getConfiguredRaysAppTypeCode
(
Long
resourcePageColumnId
)
{
public
List
<
String
>
getConfiguredRaysAppTypeCode
(
Long
resourcePageColumnId
)
{
return
resourcePageItemDao
.
getConfiguredRaysAppTypeCode
(
resourcePageColumnId
);
return
resourcePageItemDao
.
getConfiguredRaysAppTypeCode
(
resourcePageColumnId
);
}
}
@Override
public
Boolean
checkBookChildGrade
(
Long
bookId
,
Long
adviserId
,
Long
channelId
)
{
//获取书刊匹配的年级标签
BookAdviserDto
bookAdviserDto
=
bookAdviserBiz
.
getBase
(
bookId
,
channelId
,
adviserId
);
if
(
null
==
bookAdviserDto
)
{
return
false
;
}
Long
gradeId
=
null
;
if
(
null
!=
bookAdviserDto
.
getGraLabelId
())
{
gradeId
=
this
.
getGradeByGradeLabelId
(
bookAdviserDto
.
getGraLabelId
());
}
if
(
null
!=
bookAdviserDto
.
getDepLabelId
())
{
gradeId
=
this
.
getGradeByDepLabelId
(
bookAdviserDto
.
getDepLabelId
());
}
if
(
null
==
gradeId
)
{
return
false
;
}
//小学段所有年级
List
<
Long
>
gradeLabelIds
=
readerConsr
.
getUserGradeIdByParentId
(
2L
);
if
(!
ListUtils
.
isEmpty
(
gradeLabelIds
)
&&
gradeLabelIds
.
contains
(
gradeId
))
{
return
true
;
}
return
false
;
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/service/impl/BookGroupServiceImpl.java
View file @
86f2474b
...
@@ -496,4 +496,12 @@ public class BookGroupServiceImpl implements BookGroupService {
...
@@ -496,4 +496,12 @@ public class BookGroupServiceImpl implements BookGroupService {
public
ResponseEntity
<
ResponseDto
<
List
<
String
>>>
getConfiguredRaysAppTypeCode
(
@RequestParam
(
"resourcePageColumnId"
)
Long
resourcePageColumnId
)
{
public
ResponseEntity
<
ResponseDto
<
List
<
String
>>>
getConfiguredRaysAppTypeCode
(
@RequestParam
(
"resourcePageColumnId"
)
Long
resourcePageColumnId
)
{
return
ResponseHandleUtil
.
toResponse
(
resourcePageBiz
.
getConfiguredRaysAppTypeCode
(
resourcePageColumnId
));
return
ResponseHandleUtil
.
toResponse
(
resourcePageBiz
.
getConfiguredRaysAppTypeCode
(
resourcePageColumnId
));
}
}
@Override
@GetMapping
(
"checkBookChildGrade"
)
public
ResponseEntity
<
ResponseDto
<
Boolean
>>
checkBookChildGrade
(
@RequestParam
(
"bookId"
)
Long
bookId
,
@RequestParam
(
"adviserId"
)
Long
adviserId
,
@RequestParam
(
"channelId"
)
Long
channelId
)
{
return
ResponseHandleUtil
.
toResponse
(
resourcePageBiz
.
checkBookChildGrade
(
bookId
,
adviserId
,
channelId
));
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/util/common/ThreadPoolUtils.java
View file @
86f2474b
...
@@ -80,6 +80,10 @@ public class ThreadPoolUtils {
...
@@ -80,6 +80,10 @@ public class ThreadPoolUtils {
public
static
final
ExecutorService
SMALL_THREAD_POOL
=
new
ThreadPoolExecutor
(
8
,
8
,
0L
,
TimeUnit
.
SECONDS
,
public
static
final
ExecutorService
SMALL_THREAD_POOL
=
new
ThreadPoolExecutor
(
8
,
8
,
0L
,
TimeUnit
.
SECONDS
,
new
LinkedBlockingQueue
<>(),
new
ThreadFactoryBuilder
().
setNameFormat
(
"small-pool-%d"
).
build
(),
new
ThreadPoolExecutor
.
CallerRunsPolicy
());
new
LinkedBlockingQueue
<>(),
new
ThreadFactoryBuilder
().
setNameFormat
(
"small-pool-%d"
).
build
(),
new
ThreadPoolExecutor
.
CallerRunsPolicy
());
public
static
final
ExecutorService
RESOURCE_POOL
=
new
ThreadPoolExecutor
(
8
,
8
,
0L
,
TimeUnit
.
SECONDS
,
new
LinkedBlockingQueue
<>(),
new
ThreadFactoryBuilder
().
setNameFormat
(
"resource-pool-%d"
).
build
(),
new
ThreadPoolExecutor
.
CallerRunsPolicy
());
/**
/**
* 超级搜索更新线程
* 超级搜索更新线程
*/
*/
...
...
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