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
39abf6e7
Commit
39abf6e7
authored
Mar 16, 2022
by
朱亚洁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:[1006821]getResourcePageByBookGroupId4Wechat
parent
420cdcf7
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
187 additions
and
58 deletions
+187
-58
ResourcePageBizImpl.java
...a/com/pcloud/book/group/biz/impl/ResourcePageBizImpl.java
+99
-58
ResourcePageBookstoreBizImpl.java
...oud/book/group/biz/impl/ResourcePageBookstoreBizImpl.java
+3
-0
BookAppletSceneDao.java
...in/java/com/pcloud/book/group/dao/BookAppletSceneDao.java
+4
-0
ResourcePageCollectDao.java
...ava/com/pcloud/book/group/dao/ResourcePageCollectDao.java
+3
-0
ResourcePageDao.java
.../main/java/com/pcloud/book/group/dao/ResourcePageDao.java
+4
-0
BookAppletSceneDaoImpl.java
...om/pcloud/book/group/dao/impl/BookAppletSceneDaoImpl.java
+10
-0
ResourcePageCollectDaoImpl.java
...cloud/book/group/dao/impl/ResourcePageCollectDaoImpl.java
+8
-0
ResourcePageDaoImpl.java
...a/com/pcloud/book/group/dao/impl/ResourcePageDaoImpl.java
+10
-0
BookAppletScene.xml
...-book/src/main/resources/mapper/group/BookAppletScene.xml
+19
-0
ResourcePageCollectDao.xml
...rc/main/resources/mapper/group/ResourcePageCollectDao.xml
+11
-0
ResourcePageDao.xml
...-book/src/main/resources/mapper/group/ResourcePageDao.xml
+16
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/ResourcePageBizImpl.java
View file @
39abf6e7
...
@@ -8,7 +8,6 @@ import com.pcloud.advertising.advertising.dto.AdvertisingSpaceDTO;
...
@@ -8,7 +8,6 @@ import com.pcloud.advertising.advertising.dto.AdvertisingSpaceDTO;
import
com.pcloud.advertising.advertising.dto.AdvertisingSpaceItemDTO
;
import
com.pcloud.advertising.advertising.dto.AdvertisingSpaceItemDTO
;
import
com.pcloud.analysisengine.browse.dto.BrowseRecordStatisticDTO
;
import
com.pcloud.analysisengine.browse.dto.BrowseRecordStatisticDTO
;
import
com.pcloud.appcenter.app.dto.AppDto
;
import
com.pcloud.appcenter.app.dto.AppDto
;
import
com.pcloud.appcenter.app.dto.app.MapBaseStatusDTO
;
import
com.pcloud.book.applet.biz.AppletBooklistBiz
;
import
com.pcloud.book.applet.biz.AppletBooklistBiz
;
import
com.pcloud.book.applet.biz.AppletGroupSearchRecordBiz
;
import
com.pcloud.book.applet.biz.AppletGroupSearchRecordBiz
;
import
com.pcloud.book.applet.biz.AppletRecordAggrStatisBiz
;
import
com.pcloud.book.applet.biz.AppletRecordAggrStatisBiz
;
...
@@ -176,15 +175,13 @@ import java.util.List;
...
@@ -176,15 +175,13 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.Objects
;
import
java.util.Optional
;
import
java.util.Optional
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.concurrent.ExecutionException
;
import
java.util.concurrent.ExecutionException
;
import
java.util.concurrent.Future
;
import
java.util.concurrent.Future
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeoutException
;
import
java.util.concurrent.TimeoutException
;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
javax.security.auth.callback.CallbackHandler
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.io.FileUtil
;
import
cn.hutool.core.io.FileUtil
;
...
@@ -1949,45 +1946,67 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
...
@@ -1949,45 +1946,67 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
if
(
null
==
bookGroupId
&&
null
==
sceneId
)
{
if
(
null
==
bookGroupId
&&
null
==
sceneId
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"参数缺失"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"参数缺失"
);
}
}
ResourcePage
byScene
Id
=
null
;
Long
book
Id
=
null
;
if
(
null
!=
bookGroupId
)
{
if
(
null
!=
bookGroupId
)
{
b
ySceneId
=
resourcePageDao
.
get
ByBookGroupId
(
bookGroupId
);
b
ookId
=
resourcePageDao
.
getBookId
ByBookGroupId
(
bookGroupId
);
}
else
if
(
null
!=
sceneId
)
{
}
else
if
(
null
!=
sceneId
)
{
b
ySceneId
=
resourcePageDao
.
get
BySceneId
(
sceneId
);
b
ookId
=
resourcePageDao
.
getBookId
BySceneId
(
sceneId
);
}
}
//上邮临时处理方案
//上邮临时处理方案
if
(
null
!=
b
ySceneId
&&
null
!=
bySceneId
.
getBookId
()
&&
null
!=
JedisClusterUtils
.
hget
(
nftReleaseLockKey
,
bySceneId
.
getBookId
()
.
toString
()))
{
if
(
null
!=
b
ookId
&&
null
!=
JedisClusterUtils
.
hget
(
nftReleaseLockKey
,
bookId
.
toString
()))
{
if
(
null
!=
bookGroupId
)
{
if
(
null
!=
bookGroupId
)
{
bookGroupId
=
JedisClusterUtils
.
hgetJson2Class
(
nftReleaseLockKey
,
b
ySceneId
.
getBookId
()
.
toString
(),
NftBookState
.
class
).
getNftBookGroupId
();
bookGroupId
=
JedisClusterUtils
.
hgetJson2Class
(
nftReleaseLockKey
,
b
ookId
.
toString
(),
NftBookState
.
class
).
getNftBookGroupId
();
}
else
if
(
null
!=
sceneId
)
{
}
else
if
(
null
!=
sceneId
)
{
sceneId
=
JedisClusterUtils
.
hgetJson2Class
(
nftReleaseLockKey
,
b
ySceneId
.
getBookId
()
.
toString
(),
NftBookState
.
class
).
getNftSceneId
();;
sceneId
=
JedisClusterUtils
.
hgetJson2Class
(
nftReleaseLockKey
,
b
ookId
.
toString
(),
NftBookState
.
class
).
getNftSceneId
();;
}
}
}
}
ResourcePageVO
resourceP
ageVO
=
new
ResourcePageVO
();
ResourcePageVO
p
ageVO
=
new
ResourcePageVO
();
if
(
null
!=
bookGroupId
)
{
if
(
null
!=
bookGroupId
)
{
resourceP
ageVO
=
getResourcePageByBookGroupId4Wechat
(
bookGroupId
,
wechatUserId
);
p
ageVO
=
getResourcePageByBookGroupId4Wechat
(
bookGroupId
,
wechatUserId
);
}
else
if
(
null
!=
sceneId
)
{
}
else
if
(
null
!=
sceneId
)
{
resourceP
ageVO
=
getResourcePageBySceneId4Wechat
(
sceneId
);
p
ageVO
=
getResourcePageBySceneId4Wechat
(
sceneId
);
}
}
ResourcePageVO
resourcePageVO
=
pageVO
;
if
(
null
!=
resourcePageVO
.
getId
())
{
if
(
null
!=
resourcePageVO
.
getId
())
{
//查收藏状态
//查收藏状态
ResourcePageCollect
collect
=
resourcePageCollectDao
.
getCollectRecordByUser
(
wechatUserId
,
resourcePageVO
.
getId
());
Integer
collectState
=
resourcePageCollectDao
.
getCollectStateByUser
(
wechatUserId
,
resourcePageVO
.
getId
());
resourcePageVO
.
setCollectState
(
null
==
collect
?
0
:
1
);
resourcePageVO
.
setCollectState
(
null
==
collectState
?
0
:
1
);
// 实体店铺
resourcePageVO
.
setResourcePageBookstoreList
(
resourcePageBookstoreBiz
.
getByResourcePageId
(
resourcePageVO
.
getId
(),
resourcePageVO
.
getChannelId
(),
wechatUserId
,
ResourcePageFixtureTypeEnum
.
BOOKSTORE
));
// 优惠券
resourcePageVO
.
setResourcePageCouponList
(
resourcePageBookstoreBiz
.
getByResourcePageId
(
resourcePageVO
.
getId
(),
resourcePageVO
.
getChannelId
(),
wechatUserId
,
ResourcePageFixtureTypeEnum
.
COUPONS
));
}
else
{
resourcePageVO
.
setResourcePageBookstoreList
(
CollUtil
.
toList
());
resourcePageVO
.
setResourcePageCouponList
(
CollUtil
.
toList
());
}
if
(
null
!=
resourcePageVO
.
getAdviserId
())
{
resourcePageVO
.
setPushTextOpenStatus
(
qrcodeSceneConsr
.
getPushTextOpenStatus
(
resourcePageVO
.
getAdviserId
()));
}
}
// 实体店铺
CompletableFuture
<
List
<
ResourcePageBookstoreVO
>>
storeFuture
=
CompletableFuture
.
supplyAsync
(()
->
{
return
resourcePageBookstoreBiz
.
getByResourcePageId
(
resourcePageVO
.
getId
(),
resourcePageVO
.
getChannelId
(),
wechatUserId
,
ResourcePageFixtureTypeEnum
.
BOOKSTORE
);
});
// 优惠券
CompletableFuture
<
List
<
ResourcePageBookstoreVO
>>
couponFuture
=
CompletableFuture
.
supplyAsync
(()
->
{
return
resourcePageBookstoreBiz
.
getByResourcePageId
(
resourcePageVO
.
getId
(),
resourcePageVO
.
getChannelId
(),
wechatUserId
,
ResourcePageFixtureTypeEnum
.
COUPONS
);
});
//加载导航
//加载导航
this
.
fillNavigation
(
resourcePageVO
,
wechatUserId
);
CompletableFuture
<
Void
>
navigationFuture
=
CompletableFuture
.
runAsync
(()
->
{
this
.
fillNavigation
(
resourcePageVO
,
wechatUserId
);
});
//加载企业微信落地页信息
//加载企业微信落地页信息
this
.
fillWxworkPage
(
resourcePageVO
);
CompletableFuture
<
Void
>
wxworkPageFuture
=
CompletableFuture
.
runAsync
(()
->
{
this
.
fillWxworkPage
(
resourcePageVO
);
});
//扫码推送二维码名称权限状态
CompletableFuture
<
Integer
>
pushTextFuture
=
CompletableFuture
.
supplyAsync
(()
->
{
return
qrcodeSceneConsr
.
getPushTextOpenStatus
(
resourcePageVO
.
getAdviserId
());
});
CompletableFuture
.
allOf
(
storeFuture
,
couponFuture
,
navigationFuture
,
wxworkPageFuture
,
pushTextFuture
).
join
();
List
<
ResourcePageBookstoreVO
>
bookstoreVOS
=
new
ArrayList
<>();
List
<
ResourcePageBookstoreVO
>
couponVOS
=
new
ArrayList
<>();
Integer
pushTextPermission
=
0
;
try
{
bookstoreVOS
=
storeFuture
.
get
(
ThreadPoolUtils
.
REMOTE_TIME_OUT
,
TimeUnit
.
SECONDS
);
couponVOS
=
couponFuture
.
get
(
ThreadPoolUtils
.
REMOTE_TIME_OUT
,
TimeUnit
.
SECONDS
);
pushTextPermission
=
pushTextFuture
.
get
(
ThreadPoolUtils
.
REMOTE_TIME_OUT
,
TimeUnit
.
SECONDS
);
}
catch
(
InterruptedException
|
ExecutionException
|
TimeoutException
e
)
{
log
.
error
(
"查询实体店铺/优惠券失败"
+
e
.
getMessage
(),
e
);
}
resourcePageVO
.
setResourcePageBookstoreList
(
bookstoreVOS
);
resourcePageVO
.
setResourcePageCouponList
(
couponVOS
);
resourcePageVO
.
setPushTextOpenStatus
(
pushTextPermission
);
return
resourcePageVO
;
return
resourcePageVO
;
}
}
...
@@ -2021,8 +2040,8 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
...
@@ -2021,8 +2040,8 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
}
}
resourcePageVO
.
setLastReadTime
(
DateUtils
.
formatDate
(
new
Date
()));
resourcePageVO
.
setLastReadTime
(
DateUtils
.
formatDate
(
new
Date
()));
//小程序
//小程序
BookAppletScene
bookAppletScene
=
bookAppletSceneDao
.
get
ByBookGroupId
(
bookGroupId
);
String
appletId
=
bookAppletSceneDao
.
getAppletId
ByBookGroupId
(
bookGroupId
);
resourcePageVO
.
setAppletId
(
null
==
bookAppletScene
?
null
:
bookAppletScene
.
getAppletId
()
);
resourcePageVO
.
setAppletId
(
appletId
);
ResourcePage
resourcePage
=
resourcePageDao
.
getByBookGroupId
(
bookGroupId
);
ResourcePage
resourcePage
=
resourcePageDao
.
getByBookGroupId
(
bookGroupId
);
if
(
null
!=
resourcePage
)
{
if
(
null
!=
resourcePage
)
{
resourcePageVO
.
setShowBook
(
resourcePage
.
getShowBook
());
resourcePageVO
.
setShowBook
(
resourcePage
.
getShowBook
());
...
@@ -2048,35 +2067,9 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
...
@@ -2048,35 +2067,9 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
private
ResourcePageVO
getResourcePageBySceneId4Wechat
(
Long
sceneId
)
{
private
ResourcePageVO
getResourcePageBySceneId4Wechat
(
Long
sceneId
)
{
ResourcePageVO
resourcePageVO
=
new
ResourcePageVO
();
ResourcePageVO
resourcePageVO
=
new
ResourcePageVO
();
resourcePageVO
.
setSceneId
(
sceneId
);
resourcePageVO
.
setSceneId
(
sceneId
);
Map
<
Long
,
QrcodeSceneDto
>
qrcodeSceneDtoMap
=
qrcodeSceneConsr
.
listBaseInfoByIds
(
Arrays
.
asList
(
sceneId
));
Future
<
Map
<
Long
,
QrcodeSceneDto
>>
qrcodeFuture
=
ThreadPoolUtils
.
RESOURCE_POOL
.
submit
(()->{
if
(!
MapUtils
.
isEmpty
(
qrcodeSceneDtoMap
)
&&
qrcodeSceneDtoMap
.
containsKey
(
sceneId
))
{
return
qrcodeSceneConsr
.
listBaseInfoByIds
(
Arrays
.
asList
(
sceneId
));
QrcodeSceneDto
qrcodeSceneDto
=
qrcodeSceneDtoMap
.
get
(
sceneId
);
});
Long
bookId
=
qrcodeSceneDto
.
getAdviserBookId
();
Long
adviserId
=
qrcodeSceneDto
.
getCreatedByUserLogin
();
Long
channelId
=
qrcodeSceneDto
.
getChannelPartyId
();
resourcePageVO
.
setBookId
(
bookId
);
resourcePageVO
.
setAdviserId
(
adviserId
);
resourcePageVO
.
setChannelId
(
channelId
);
resourcePageVO
.
setQrcodeName
(
qrcodeSceneDto
.
getSceneName
());
if
(
null
!=
bookId
)
{
BookDto
bookDto
=
bookBiz
.
getBaseById
(
bookId
);
if
(
null
!=
bookDto
)
{
resourcePageVO
.
setBookImg
(
bookDto
.
getCoverImg
());
resourcePageVO
.
setBookName
(
bookDto
.
getBookName
());
}
}
Map
<
Long
,
AdviserBaseInfoDto
>
agentMap
=
adviserConsr
.
getAdviserId2AdviserInfoDtoMap
(
Arrays
.
asList
(
adviserId
));
if
(!
MapUtils
.
isEmpty
(
agentMap
))
{
resourcePageVO
.
setAgentName
(
Optional
.
ofNullable
(
agentMap
.
get
(
adviserId
)).
orElseGet
(
AdviserBaseInfoDto:
:
new
).
getAgentName
());
}
AccountSettingDto
accountSettingDto
=
qrcodeSceneConsr
.
getWechatInfo
(
channelId
);
if
(
accountSettingDto
!=
null
){
resourcePageVO
.
setAccountSettingId
(
accountSettingDto
.
getAccountSettingId
());
}
}
//小程序
BookAppletScene
bookAppletScene
=
bookAppletSceneDao
.
getBySceneId
(
sceneId
);
resourcePageVO
.
setAppletId
(
null
==
bookAppletScene
?
null
:
bookAppletScene
.
getAppletId
());
ResourcePage
resourcePage
=
resourcePageDao
.
getBySceneId
(
sceneId
);
ResourcePage
resourcePage
=
resourcePageDao
.
getBySceneId
(
sceneId
);
if
(
null
!=
resourcePage
)
{
if
(
null
!=
resourcePage
)
{
resourcePageVO
.
setShowBook
(
resourcePage
.
getShowBook
());
resourcePageVO
.
setShowBook
(
resourcePage
.
getShowBook
());
...
@@ -2097,6 +2090,54 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
...
@@ -2097,6 +2090,54 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
resourcePageVO
.
setNavigationJumpType
(
resourcePage
.
getNavigationJumpType
());
resourcePageVO
.
setNavigationJumpType
(
resourcePage
.
getNavigationJumpType
());
resourcePageVO
.
setIsShowPrice
(
resourcePage
.
getIsShowPrice
());
resourcePageVO
.
setIsShowPrice
(
resourcePage
.
getIsShowPrice
());
}
}
//小程序
resourcePageVO
.
setAppletId
(
bookAppletSceneDao
.
getAppletIdBySceneId
(
sceneId
));
Map
<
Long
,
QrcodeSceneDto
>
qrcodeSceneDtoMap
=
new
HashMap
<>();
try
{
qrcodeSceneDtoMap
=
qrcodeFuture
.
get
(
ThreadPoolUtils
.
REMOTE_TIME_OUT
,
TimeUnit
.
SECONDS
);
}
catch
(
Exception
e
)
{
log
.
error
(
"查二维码失败"
+
e
.
getMessage
(),
e
);
}
if
(!
MapUtils
.
isEmpty
(
qrcodeSceneDtoMap
)
&&
qrcodeSceneDtoMap
.
containsKey
(
sceneId
))
{
QrcodeSceneDto
qrcodeSceneDto
=
qrcodeSceneDtoMap
.
get
(
sceneId
);
Long
bookId
=
qrcodeSceneDto
.
getAdviserBookId
();
resourcePageVO
.
setBookId
(
bookId
);
resourcePageVO
.
setAdviserId
(
qrcodeSceneDto
.
getCreatedByUserLogin
());
resourcePageVO
.
setChannelId
(
qrcodeSceneDto
.
getChannelPartyId
());
resourcePageVO
.
setQrcodeName
(
qrcodeSceneDto
.
getSceneName
());
if
(
null
!=
bookId
)
{
BookDto
bookDto
=
bookBiz
.
getBaseById
(
bookId
);
if
(
null
!=
bookDto
)
{
resourcePageVO
.
setBookImg
(
bookDto
.
getCoverImg
());
resourcePageVO
.
setBookName
(
bookDto
.
getBookName
());
}
}
}
Long
adviserId
=
resourcePageVO
.
getAdviserId
();
CompletableFuture
<
Map
<
Long
,
AdviserBaseInfoDto
>>
agentFuture
=
CompletableFuture
.
supplyAsync
(()
->
{
return
adviserConsr
.
getAdviserId2AdviserInfoDtoMap
(
null
==
adviserId
?
new
ArrayList
<>():
Arrays
.
asList
(
adviserId
));
});
CompletableFuture
<
AccountSettingDto
>
accountSettingFuture
=
CompletableFuture
.
supplyAsync
(()
->
{
return
qrcodeSceneConsr
.
getWechatInfo
(
resourcePageVO
.
getChannelId
());
});
CompletableFuture
.
allOf
(
agentFuture
,
accountSettingFuture
).
join
();
Map
<
Long
,
AdviserBaseInfoDto
>
agentMap
=
new
HashMap
<>();
AccountSettingDto
accountSettingDto
=
new
AccountSettingDto
();
try
{
agentMap
=
agentFuture
.
get
(
ThreadPoolUtils
.
REMOTE_TIME_OUT
,
TimeUnit
.
SECONDS
);
accountSettingDto
=
accountSettingFuture
.
get
(
ThreadPoolUtils
.
REMOTE_TIME_OUT
,
TimeUnit
.
SECONDS
);
}
catch
(
InterruptedException
|
ExecutionException
|
TimeoutException
e
)
{
log
.
error
(
"查询出版社/公众号失败"
+
e
.
getMessage
(),
e
);
}
if
(!
MapUtils
.
isEmpty
(
agentMap
))
{
resourcePageVO
.
setAgentName
(
Optional
.
ofNullable
(
agentMap
.
get
(
adviserId
)).
orElseGet
(
AdviserBaseInfoDto:
:
new
).
getAgentName
());
}
if
(
accountSettingDto
!=
null
){
resourcePageVO
.
setAccountSettingId
(
accountSettingDto
.
getAccountSettingId
());
}
return
resourcePageVO
;
return
resourcePageVO
;
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/ResourcePageBookstoreBizImpl.java
View file @
39abf6e7
...
@@ -99,6 +99,9 @@ public class ResourcePageBookstoreBizImpl implements ResourcePageBookstoreBiz {
...
@@ -99,6 +99,9 @@ public class ResourcePageBookstoreBizImpl implements ResourcePageBookstoreBiz {
@Override
@Override
public
List
<
ResourcePageBookstoreVO
>
getByResourcePageId
(
Long
resourcePageId
,
Long
channelId
,
Long
wechatUserId
,
ResourcePageFixtureTypeEnum
fixtureTypeEnum
)
{
public
List
<
ResourcePageBookstoreVO
>
getByResourcePageId
(
Long
resourcePageId
,
Long
channelId
,
Long
wechatUserId
,
ResourcePageFixtureTypeEnum
fixtureTypeEnum
)
{
if
(
null
==
resourcePageId
)
{
return
CollUtil
.
toList
();
}
List
<
ResourcePageBookstoreVO
>
list
=
resourcePageBookstoreDao
.
getByResourcePageId
(
resourcePageId
,
fixtureTypeEnum
.
fixtureType
);
List
<
ResourcePageBookstoreVO
>
list
=
resourcePageBookstoreDao
.
getByResourcePageId
(
resourcePageId
,
fixtureTypeEnum
.
fixtureType
);
if
(
CollUtil
.
isEmpty
(
list
)){
if
(
CollUtil
.
isEmpty
(
list
)){
return
CollUtil
.
toList
();
return
CollUtil
.
toList
();
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/BookAppletSceneDao.java
View file @
39abf6e7
...
@@ -55,4 +55,8 @@ public interface BookAppletSceneDao extends BaseDao<BookAppletScene> {
...
@@ -55,4 +55,8 @@ public interface BookAppletSceneDao extends BaseDao<BookAppletScene> {
* @return
* @return
*/
*/
BookAppletSceneDTO
getBookAppletByBookId
(
Long
bookId
,
Long
channelId
,
Long
adviserId
);
BookAppletSceneDTO
getBookAppletByBookId
(
Long
bookId
,
Long
channelId
,
Long
adviserId
);
String
getAppletIdByBookGroupId
(
Long
bookGroupId
);
String
getAppletIdBySceneId
(
Long
sceneId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/ResourcePageCollectDao.java
View file @
39abf6e7
...
@@ -27,4 +27,6 @@ public interface ResourcePageCollectDao extends BaseDao<ResourcePageCollect>{
...
@@ -27,4 +27,6 @@ public interface ResourcePageCollectDao extends BaseDao<ResourcePageCollect>{
* * @param null
* * @param null
*/
*/
Integer
getUserIsNotNew
(
Long
wechatUserId
);
Integer
getUserIsNotNew
(
Long
wechatUserId
);
Integer
getCollectStateByUser
(
Long
wechatUserId
,
Long
resourcePageId
);
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/ResourcePageDao.java
View file @
39abf6e7
...
@@ -125,4 +125,8 @@ public interface ResourcePageDao extends BaseDao<ResourcePage>{
...
@@ -125,4 +125,8 @@ public interface ResourcePageDao extends BaseDao<ResourcePage>{
* * @param null
* * @param null
*/
*/
void
updateNavigationFormat
(
Long
resourcePageId
,
Integer
navigationColor
,
Integer
navigationFormat
,
Integer
navigationJumpType
);
void
updateNavigationFormat
(
Long
resourcePageId
,
Integer
navigationColor
,
Integer
navigationFormat
,
Integer
navigationJumpType
);
Long
getBookIdByBookGroupId
(
Long
bookGroupId
);
Long
getBookIdBySceneId
(
Long
sceneId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/impl/BookAppletSceneDaoImpl.java
View file @
39abf6e7
...
@@ -56,4 +56,14 @@ public class BookAppletSceneDaoImpl extends BaseDaoImpl<BookAppletScene> impleme
...
@@ -56,4 +56,14 @@ public class BookAppletSceneDaoImpl extends BaseDaoImpl<BookAppletScene> impleme
map
.
put
(
"adviserId"
,
adviserId
);
map
.
put
(
"adviserId"
,
adviserId
);
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getBookAppletByBookId"
),
map
);
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getBookAppletByBookId"
),
map
);
}
}
@Override
public
String
getAppletIdByBookGroupId
(
Long
bookGroupId
)
{
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getAppletIdByBookGroupId"
),
bookGroupId
);
}
@Override
public
String
getAppletIdBySceneId
(
Long
sceneId
)
{
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getAppletIdBySceneId"
),
sceneId
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/impl/ResourcePageCollectDaoImpl.java
View file @
39abf6e7
...
@@ -31,4 +31,12 @@ public class ResourcePageCollectDaoImpl extends BaseDaoImpl<ResourcePageCollect>
...
@@ -31,4 +31,12 @@ public class ResourcePageCollectDaoImpl extends BaseDaoImpl<ResourcePageCollect>
public
Integer
getUserIsNotNew
(
Long
wechatUserId
)
{
public
Integer
getUserIsNotNew
(
Long
wechatUserId
)
{
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getUserIsNotNew"
),
wechatUserId
);
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getUserIsNotNew"
),
wechatUserId
);
}
}
@Override
public
Integer
getCollectStateByUser
(
Long
wechatUserId
,
Long
resourcePageId
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"wechatUserId"
,
wechatUserId
);
map
.
put
(
"resourcePageId"
,
resourcePageId
);
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getCollectStateByUser"
),
map
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/impl/ResourcePageDaoImpl.java
View file @
39abf6e7
...
@@ -166,4 +166,14 @@ public class ResourcePageDaoImpl extends BaseDaoImpl<ResourcePage> implements Re
...
@@ -166,4 +166,14 @@ public class ResourcePageDaoImpl extends BaseDaoImpl<ResourcePage> implements Re
map
.
put
(
"navigationJumpType"
,
navigationJumpType
);
map
.
put
(
"navigationJumpType"
,
navigationJumpType
);
getSessionTemplate
().
update
(
getStatement
(
"updateNavigationFormat"
),
map
);
getSessionTemplate
().
update
(
getStatement
(
"updateNavigationFormat"
),
map
);
}
}
@Override
public
Long
getBookIdByBookGroupId
(
Long
bookGroupId
)
{
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getBookIdByBookGroupId"
),
bookGroupId
);
}
@Override
public
Long
getBookIdBySceneId
(
Long
sceneId
)
{
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getBookIdBySceneId"
),
sceneId
);
}
}
}
pcloud-service-book/src/main/resources/mapper/group/BookAppletScene.xml
View file @
39abf6e7
...
@@ -141,4 +141,22 @@
...
@@ -141,4 +141,22 @@
limit 1
limit 1
</select>
</select>
<select
id=
"getAppletIdByBookGroupId"
parameterType=
"long"
resultType=
"string"
>
SELECT
applet_id
FROM book_applet_scene
WHERE book_group_id=#{bookGroupId}
AND is_delete = 0
limit 1
</select>
<select
id=
"getAppletIdBySceneId"
parameterType=
"long"
resultType=
"string"
>
SELECT
applet_id
FROM book_applet_scene
WHERE scene_id=#{sceneId}
AND is_delete = 0
limit 1
</select>
</mapper>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/group/ResourcePageCollectDao.xml
View file @
39abf6e7
...
@@ -71,4 +71,14 @@
...
@@ -71,4 +71,14 @@
and is_new = 0
and is_new = 0
</select>
</select>
<select
id=
"getCollectStateByUser"
parameterType=
"map"
resultType=
"integer"
>
select
collect_state
from resource_page_collect
where resource_page_id = #{resourcePageId}
and wechat_user_id = #{wechatUserId}
and collect_state = 1
limit 1
</select>
</mapper>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/group/ResourcePageDao.xml
View file @
39abf6e7
...
@@ -355,4 +355,20 @@
...
@@ -355,4 +355,20 @@
where id = #{id}
where id = #{id}
</select>
</select>
<select
id=
"getBookIdByBookGroupId"
parameterType=
"long"
resultType=
"long"
>
select
book_id
from resource_page
where book_group_id = #{bookGroupId}
limit 1
</select>
<select
id=
"getBookIdBySceneId"
parameterType=
"long"
resultType=
"long"
>
select
book_id
from resource_page
where scene_id = #{sceneId}
limit 1
</select>
</mapper>
</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