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
f48731c3
Commit
f48731c3
authored
Sep 29, 2021
by
朱亚洁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:[none]appletSql
parent
a21a5992
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
52 additions
and
2 deletions
+52
-2
AppletThirdResourcesBizImpl.java
...oud/book/applet/biz/impl/AppletThirdResourcesBizImpl.java
+19
-2
AppletConstants.java
...java/com/pcloud/book/applet/contants/AppletConstants.java
+5
-0
AppletThirdResourcesDao.java
...a/com/pcloud/book/applet/dao/AppletThirdResourcesDao.java
+2
-0
AppletThirdResourcesDaoImpl.java
...oud/book/applet/dao/impl/AppletThirdResourcesDaoImpl.java
+7
-0
QrcodeSceneConsr.java
...va/com/pcloud/book/consumer/channel/QrcodeSceneConsr.java
+6
-0
AppletThirdResources.xml
...src/main/resources/mapper/applet/AppletThirdResources.xml
+13
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/applet/biz/impl/AppletThirdResourcesBizImpl.java
View file @
f48731c3
...
@@ -2,6 +2,7 @@ package com.pcloud.book.applet.biz.impl;
...
@@ -2,6 +2,7 @@ package com.pcloud.book.applet.biz.impl;
import
com.pcloud.book.applet.biz.AppletResourceApplyBiz
;
import
com.pcloud.book.applet.biz.AppletResourceApplyBiz
;
import
com.pcloud.book.applet.biz.AppletThirdResourcesBiz
;
import
com.pcloud.book.applet.biz.AppletThirdResourcesBiz
;
import
com.pcloud.book.applet.contants.AppletConstants
;
import
com.pcloud.book.applet.contants.AppletResourceApplyConstants
;
import
com.pcloud.book.applet.contants.AppletResourceApplyConstants
;
import
com.pcloud.book.applet.dao.AppletLinkClickDao
;
import
com.pcloud.book.applet.dao.AppletLinkClickDao
;
import
com.pcloud.book.applet.dao.AppletNewsDao
;
import
com.pcloud.book.applet.dao.AppletNewsDao
;
...
@@ -28,6 +29,7 @@ import com.pcloud.common.page.PageBeanNew;
...
@@ -28,6 +29,7 @@ import com.pcloud.common.page.PageBeanNew;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.utils.DateUtils
;
import
com.pcloud.common.utils.DateUtils
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.cache.redis.JedisClusterUtils
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.readercenter.wechat.entity.WechatUser
;
import
com.pcloud.readercenter.wechat.entity.WechatUser
;
...
@@ -434,11 +436,22 @@ public class AppletThirdResourcesBizImpl implements AppletThirdResourcesBiz {
...
@@ -434,11 +436,22 @@ public class AppletThirdResourcesBizImpl implements AppletThirdResourcesBiz {
@Override
@Override
public
PageBeanNew
<
AppletThirdResources
>
getThirdResourcesByGradeLabel4ResourcePage
(
Long
gradeLabelId
,
Integer
currentPage
,
Integer
numPerPage
)
{
public
PageBeanNew
<
AppletThirdResources
>
getThirdResourcesByGradeLabel4ResourcePage
(
Long
gradeLabelId
,
Integer
currentPage
,
Integer
numPerPage
)
{
String
startDate
=
DateUtils
.
formatDate
(
DateUtils
.
addDay
(
new
Date
(),
-
7
),
DateUtils
.
DATE_FORMAT_DATEONLY
);
String
startDate
=
DateUtils
.
formatDate
(
DateUtils
.
addDay
(
new
Date
(),
-
7
),
DateUtils
.
DATE_FORMAT_DATEONLY
);
Integer
crowdType
=
gradeLabelId
.
intValue
();
String
key
=
AppletConstants
.
H5_THIRD_RESOURCE_REDIS
+
startDate
;
String
field
=
gradeLabelId
.
toString
();
//前6条缓存中取
if
(
currentPage
==
0
&&
numPerPage
==
6
)
{
List
<
AppletThirdResources
>
resourcesList
=
JedisClusterUtils
.
hgetJson2List
(
key
,
field
,
AppletThirdResources
.
class
);
if
(!
ListUtils
.
isEmpty
(
resourcesList
))
{
Integer
count
=
thirdResourcesDao
.
countResourceIdByGradeLabel
(
crowdType
);
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
count
,
resourcesList
);
}
}
//根据标签查询,按照近7天浏览量排序
//根据标签查询,按照近7天浏览量排序
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"startDate"
,
startDate
);
paramMap
.
put
(
"startDate"
,
startDate
);
paramMap
.
put
(
"crowdType"
,
gradeLabelId
.
intValue
()
);
paramMap
.
put
(
"crowdType"
,
crowdType
);
PageBeanNew
<
Long
>
idPageBean
=
thirdResourcesDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
paramMap
,
"listResourceIdByGradeLabelAndClickCount"
);
PageBeanNew
<
Long
>
idPageBean
=
thirdResourcesDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
paramMap
,
"listResourceIdByGradeLabelAndClickCount"
,
"countResourceIdByGradeLabel"
);
if
(
ListUtils
.
isEmpty
(
idPageBean
.
getRecordList
()))
{
if
(
ListUtils
.
isEmpty
(
idPageBean
.
getRecordList
()))
{
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
idPageBean
.
getTotalCount
(),
new
ArrayList
<>());
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
idPageBean
.
getTotalCount
(),
new
ArrayList
<>());
}
}
...
@@ -446,6 +459,10 @@ public class AppletThirdResourcesBizImpl implements AppletThirdResourcesBiz {
...
@@ -446,6 +459,10 @@ public class AppletThirdResourcesBizImpl implements AppletThirdResourcesBiz {
List
<
AppletThirdResources
>
thirdResources
=
thirdResourcesDao
.
getAppletsByIds
(
idPageBean
.
getRecordList
());
List
<
AppletThirdResources
>
thirdResources
=
thirdResourcesDao
.
getAppletsByIds
(
idPageBean
.
getRecordList
());
//推送图片类型
//推送图片类型
setResourcesPic
(
thirdResources
);
setResourcesPic
(
thirdResources
);
if
(
currentPage
==
0
&&
numPerPage
==
6
&&
!
ListUtils
.
isEmpty
(
thirdResources
))
{
JedisClusterUtils
.
hset2Json
(
key
,
field
,
thirdResources
);
JedisClusterUtils
.
expire
(
key
,
2
*
60
*
60
);
}
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
idPageBean
.
getTotalCount
(),
thirdResources
);
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
idPageBean
.
getTotalCount
(),
thirdResources
);
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/applet/contants/AppletConstants.java
View file @
f48731c3
...
@@ -80,6 +80,11 @@ public class AppletConstants {
...
@@ -80,6 +80,11 @@ public class AppletConstants {
public
static
final
String
APPLET_RESOURCE_AGGR_STATIS
=
CacheConstant
.
BOOK
+
"APPLET:getAggrStatis"
;
public
static
final
String
APPLET_RESOURCE_AGGR_STATIS
=
CacheConstant
.
BOOK
+
"APPLET:getAggrStatis"
;
/**
/**
* 小睿H5第三方资源推荐
*/
public
static
final
String
H5_THIRD_RESOURCE_REDIS
=
CacheConstant
.
BOOK
+
"APPLET:thirdResource4H5"
;
/**
* 未配置答案的书刊
* 未配置答案的书刊
*/
*/
public
static
final
List
<
Long
>
NO_ANSWER_BOOK
=
Arrays
.
asList
(
public
static
final
List
<
Long
>
NO_ANSWER_BOOK
=
Arrays
.
asList
(
...
...
pcloud-service-book/src/main/java/com/pcloud/book/applet/dao/AppletThirdResourcesDao.java
View file @
f48731c3
...
@@ -19,4 +19,6 @@ public interface AppletThirdResourcesDao extends BaseDao<AppletThirdResources> {
...
@@ -19,4 +19,6 @@ public interface AppletThirdResourcesDao extends BaseDao<AppletThirdResources> {
List
<
AppletThirdResources
>
getAppletsByIds
(
List
<
Long
>
ids
);
List
<
AppletThirdResources
>
getAppletsByIds
(
List
<
Long
>
ids
);
AppletThirdResources
getByResourcesId
(
Long
id
);
AppletThirdResources
getByResourcesId
(
Long
id
);
Integer
countResourceIdByGradeLabel
(
Integer
crowdType
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/applet/dao/impl/AppletThirdResourcesDaoImpl.java
View file @
f48731c3
...
@@ -47,4 +47,11 @@ public class AppletThirdResourcesDaoImpl extends BaseDaoImpl<AppletThirdResource
...
@@ -47,4 +47,11 @@ public class AppletThirdResourcesDaoImpl extends BaseDaoImpl<AppletThirdResource
map
.
put
(
"id"
,
id
);
map
.
put
(
"id"
,
id
);
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getByResourcesId"
),
map
);
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getByResourcesId"
),
map
);
}
}
@Override
public
Integer
countResourceIdByGradeLabel
(
Integer
crowdType
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"crowdType"
,
crowdType
);
return
getSessionTemplate
().
selectOne
(
getStatement
(
"countResourceIdByGradeLabel"
),
paramMap
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/consumer/channel/QrcodeSceneConsr.java
View file @
f48731c3
...
@@ -605,6 +605,9 @@ public class QrcodeSceneConsr {
...
@@ -605,6 +605,9 @@ public class QrcodeSceneConsr {
@ParamLog
(
"查书刊订阅的公众号二维码"
)
@ParamLog
(
"查书刊订阅的公众号二维码"
)
public
GroupQrcodeVO
getSubscribeQrcode
(
Long
accountSettingId
)
{
public
GroupQrcodeVO
getSubscribeQrcode
(
Long
accountSettingId
)
{
GroupQrcodeVO
qrcodeVO
=
new
GroupQrcodeVO
();
GroupQrcodeVO
qrcodeVO
=
new
GroupQrcodeVO
();
if
(
null
==
accountSettingId
)
{
return
qrcodeVO
;
}
try
{
try
{
qrcodeVO
=
ResponseHandleUtil
.
parseResponse
(
qrcodeSceneService
.
getSubscribeQrcode
(
accountSettingId
),
GroupQrcodeVO
.
class
);
qrcodeVO
=
ResponseHandleUtil
.
parseResponse
(
qrcodeSceneService
.
getSubscribeQrcode
(
accountSettingId
),
GroupQrcodeVO
.
class
);
...
@@ -616,6 +619,9 @@ public class QrcodeSceneConsr {
...
@@ -616,6 +619,9 @@ public class QrcodeSceneConsr {
public
AccountSetting
getAppInfo
(
Long
accountSettingId
)
{
public
AccountSetting
getAppInfo
(
Long
accountSettingId
)
{
AccountSetting
accountSetting
=
new
AccountSetting
();
AccountSetting
accountSetting
=
new
AccountSetting
();
if
(
null
==
accountSettingId
)
{
return
accountSetting
;
}
try
{
try
{
accountSetting
=
ResponseHandleUtil
.
parseResponse
(
accountSettingService
.
getAppInfo
(
accountSettingId
),
AccountSetting
.
class
);
accountSetting
=
ResponseHandleUtil
.
parseResponse
(
accountSettingService
.
getAppInfo
(
accountSettingId
),
AccountSetting
.
class
);
...
...
pcloud-service-book/src/main/resources/mapper/applet/AppletThirdResources.xml
View file @
f48731c3
...
@@ -328,5 +328,17 @@
...
@@ -328,5 +328,17 @@
a.target_id DESC
a.target_id DESC
</select>
</select>
<select
id=
"countResourceIdByGradeLabel"
parameterType=
"map"
resultType=
"integer"
>
SELECT
COUNT(DISTINCT a.target_id)
FROM
applet_resource_apply a
INNER JOIN applet_third_resources r ON a.target_id = r.id
WHERE
a.crowd_type = #{crowdType}
AND a.target_type = "THIRD_RESOURCE"
AND a.target_id > 0
</select>
</mapper>
</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