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
fa563b2e
Commit
fa563b2e
authored
Aug 31, 2021
by
李传峰
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'remotes/origin/master' into feature/2.x
parents
8932cc7c
a66c0ac8
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
134 additions
and
63 deletions
+134
-63
BookAuthInfo.java
...n/java/com/pcloud/book/copyright/entity/BookAuthInfo.java
+2
-0
BookAuthInfoAndServesVO.java
...com/pcloud/book/copyright/vo/BookAuthInfoAndServesVO.java
+10
-0
BookAuthInfoVO.java
...ain/java/com/pcloud/book/copyright/vo/BookAuthInfoVO.java
+3
-0
BookAuthInfoWechatVO.java
...va/com/pcloud/book/copyright/vo/BookAuthInfoWechatVO.java
+11
-0
SetAuthOpenParam.java
...n/java/com/pcloud/book/copyright/vo/SetAuthOpenParam.java
+3
-0
ResourcePageBiz.java
.../main/java/com/pcloud/book/group/biz/ResourcePageBiz.java
+8
-8
ResourcePageBizImpl.java
...a/com/pcloud/book/group/biz/impl/ResourcePageBizImpl.java
+60
-40
ResourcePageConstants.java
...com/pcloud/book/group/constant/ResourcePageConstants.java
+16
-2
ResourcePageColumnDao.java
...java/com/pcloud/book/group/dao/ResourcePageColumnDao.java
+1
-1
ResourcePageColumnDaoImpl.java
...pcloud/book/group/dao/impl/ResourcePageColumnDaoImpl.java
+2
-1
ResourcePageFacade.java
...com/pcloud/book/group/facade/impl/ResourcePageFacade.java
+7
-7
BookAuthInfo.Mapper.xml
...c/main/resources/mapper/copyright/BookAuthInfo.Mapper.xml
+7
-3
ResourcePageColumnDao.xml
...src/main/resources/mapper/group/ResourcePageColumnDao.xml
+1
-0
ResourcePageDao.xml
...-book/src/main/resources/mapper/group/ResourcePageDao.xml
+3
-1
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/copyright/entity/BookAuthInfo.java
View file @
fa563b2e
...
...
@@ -72,4 +72,6 @@ public class BookAuthInfo extends BaseEntity {
@ApiModelProperty
(
"授权后仍需付费"
)
private
Integer
isAuthorizedPay
;
@ApiModelProperty
(
"打开支付功能;0:关闭;1:开启;"
)
private
Integer
openPay
;
}
pcloud-service-book/src/main/java/com/pcloud/book/copyright/vo/BookAuthInfoAndServesVO.java
View file @
fa563b2e
...
...
@@ -55,6 +55,8 @@ public class BookAuthInfoAndServesVO implements Serializable {
@ApiModelProperty
(
"授权后仍需付费"
)
private
Integer
isAuthorizedPay
;
@ApiModelProperty
(
"打开支付功能;0:关闭;1:开启;"
)
private
Integer
openPay
;
public
Long
getId
()
{
return
id
;
...
...
@@ -160,6 +162,14 @@ public class BookAuthInfoAndServesVO implements Serializable {
this
.
isAuthorizedPay
=
isAuthorizedPay
;
}
public
Integer
getOpenPay
()
{
return
openPay
;
}
public
void
setOpenPay
(
Integer
openPay
)
{
this
.
openPay
=
openPay
;
}
@Override
public
String
toString
()
{
return
"BookAuthInfoAndServesVO{"
+
...
...
pcloud-service-book/src/main/java/com/pcloud/book/copyright/vo/BookAuthInfoVO.java
View file @
fa563b2e
...
...
@@ -50,4 +50,7 @@ public class BookAuthInfoVO implements Serializable {
@ApiModelProperty
(
"授权后仍需付费"
)
private
Integer
isAuthorizedPay
;
@ApiModelProperty
(
"打开支付功能;0:关闭;1:开启;"
)
private
Integer
openPay
;
}
pcloud-service-book/src/main/java/com/pcloud/book/copyright/vo/BookAuthInfoWechatVO.java
View file @
fa563b2e
...
...
@@ -51,6 +51,9 @@ public class BookAuthInfoWechatVO implements Serializable {
@ApiModelProperty
(
"coverImg"
)
private
String
coverImg
;
@ApiModelProperty
(
"打开支付功能;0:关闭;1:开启;"
)
private
Integer
openPay
;
public
Long
getId
()
{
return
id
;
}
...
...
@@ -147,6 +150,14 @@ public class BookAuthInfoWechatVO implements Serializable {
this
.
coverImg
=
coverImg
;
}
public
Integer
getOpenPay
()
{
return
openPay
;
}
public
void
setOpenPay
(
Integer
openPay
)
{
this
.
openPay
=
openPay
;
}
@Override
public
String
toString
()
{
return
"BookAuthInfoWechatVO{"
+
...
...
pcloud-service-book/src/main/java/com/pcloud/book/copyright/vo/SetAuthOpenParam.java
View file @
fa563b2e
...
...
@@ -54,4 +54,7 @@ public class SetAuthOpenParam implements Serializable {
@ApiModelProperty
(
"授权后仍需付费"
)
private
Integer
isAuthorizedPay
;
@ApiModelProperty
(
"打开支付功能;0:关闭;1:开启;"
)
private
Integer
openPay
;
}
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/ResourcePageBiz.java
View file @
fa563b2e
...
...
@@ -405,14 +405,6 @@ public interface ResourcePageBiz {
List
<
BookServeDTO
>
getBookAllServeIdsIncludeUrl
(
Long
adviserId
,
Long
bookId
,
Long
channelId
);
/**
* 处理旧数据导航
* @author:zhuyajie
* @date:2021/8/16 10:51
* * @param null
*/
void
dealOldNavigation
();
/**
* 保存导航
* @author:zhuyajie
* @date:2021/8/17 16:42
...
...
@@ -440,4 +432,12 @@ public interface ResourcePageBiz {
* * @param null
*/
PageBeanNew
<
ResourcePagePic
>
listNavigationPic
(
Long
adviserId
,
Integer
currentPage
,
Integer
numPerPage
);
/**
* 批量更新栏目排序
* @author:zhuyajie
* @date:2021/8/27 19:35
* * @param null
*/
void
batchUpdateColumnSeq
(
List
<
Long
>
navigationIds
);
}
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/ResourcePageBizImpl.java
View file @
fa563b2e
...
...
@@ -285,11 +285,11 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
}
//同一本书其他码下关闭小睿流程
resourcePageDao
.
setOtherPageRaysClose
(
resourcePage
.
getBookId
(),
resourcePage
.
getChannelId
(),
resourcePage
.
getCreateUser
(),
sceneId
,
null
);
//添加
书友社区
导航
this
.
addDefaultApplet
QA
Navigation
(
resourcePage
.
getId
());
//添加
小程序默认
导航
this
.
addDefaultAppletNavigation
(
resourcePage
.
getId
());
}
else
{
//删除
书友社区
导航
resourcePageNavigationDao
.
deleteNavigation
(
resourcePage
.
getId
(),
ResourcePageConstants
.
NavigationTypeEnum
.
APPLET_QA
.
getCode
());
//删除
小程序默认
导航
this
.
deleteAppletDefaultNavigation
(
resourcePage
.
getId
());
//导航重新排序
this
.
updateNavigationSeq4Batch
(
resourcePage
.
getId
());
}
...
...
@@ -350,11 +350,11 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
}
//同一本书其他码下关闭小睿流程
resourcePageDao
.
setOtherPageRaysClose
(
resourcePage
.
getBookId
(),
resourcePage
.
getChannelId
(),
resourcePage
.
getCreateUser
(),
null
,
bookGroupId
);
//添加
书友社区
导航
this
.
addDefaultApplet
QA
Navigation
(
resourcePage
.
getId
());
//添加
小程序默认
导航
this
.
addDefaultAppletNavigation
(
resourcePage
.
getId
());
}
else
{
//删除
书友社区
导航
resourcePageNavigationDao
.
deleteNavigation
(
resourcePage
.
getId
(),
ResourcePageConstants
.
NavigationTypeEnum
.
APPLET_QA
.
getCode
());
//删除
小程序默认
导航
this
.
deleteAppletDefaultNavigation
(
resourcePage
.
getId
());
//导航重新排序
this
.
updateNavigationSeq4Batch
(
resourcePage
.
getId
());
}
...
...
@@ -389,7 +389,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
//添加默认导航
this
.
addDefaultBookServeNavigation
(
resourcePage
.
getId
());
if
(
openRays
==
1
)
{
this
.
addDefaultApplet
QA
Navigation
(
resourcePage
.
getId
());
this
.
addDefaultAppletNavigation
(
resourcePage
.
getId
());
}
return
resourcePage
;
}
...
...
@@ -1121,6 +1121,8 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
}
resourcePageVO
.
setChannelId
(
channelId
);
}
List
<
ResourcePageNavigation
>
navigations
=
resourcePageNavigationDao
.
getByPageId
(
resourcePageVO
.
getId
());
resourcePageVO
.
setNavigationList
(
navigations
);
return
resourcePageVO
;
}
...
...
@@ -1173,8 +1175,9 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
}
Long
resourcePageId
=
resourcePageColumn
.
getResourcePageId
();
Integer
columnSeq
=
resourcePageColumn
.
getColumnSeq
();
Long
navigationId
=
resourcePageColumn
.
getNavigationId
();
//获取要调换的栏目
ResourcePageColumn
column
=
resourcePageColumnDao
.
getColumByMoveType
(
moveType
,
resourcePageId
,
columnSeq
);
ResourcePageColumn
column
=
resourcePageColumnDao
.
getColumByMoveType
(
moveType
,
resourcePageId
,
columnSeq
,
navigationId
);
if
(
null
==
column
)
{
return
;
}
...
...
@@ -2129,49 +2132,53 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
}
}
@Override
public
void
dealOldNavigation
()
{
List
<
Long
>
resourcePageIds
=
resourcePageNavigationDao
.
getNoNavigationPages
(
null
);
if
(!
ListUtils
.
isEmpty
(
resourcePageIds
))
{
for
(
Long
resourcePageId
:
resourcePageIds
)
{
Long
navigationId
=
this
.
addDefaultBookServeNavigation
(
resourcePageId
);
if
(
null
!=
navigationId
)
{
resourcePageColumnDao
.
updateNavigationId
(
navigationId
,
resourcePageId
);
}
}
}
List
<
Long
>
openRaysPageIds
=
resourcePageNavigationDao
.
getNoNavigationPages
(
1
);
if
(!
ListUtils
.
isEmpty
(
openRaysPageIds
))
{
for
(
Long
resourcePageId
:
openRaysPageIds
)
{
this
.
addDefaultAppletQANavigation
(
resourcePageId
);
}
/**
* 删除小程序默认导航
* @author:zhuyajie
* @date:2021/8/27 16:01
* * @param null
*/
private
void
deleteAppletDefaultNavigation
(
Long
resourcePageId
)
{
//书友互助、阅读打卡
List
<
Integer
>
types
=
ResourcePageConstants
.
APPLET_DEFAULT_NAVIGATIONS
;
for
(
Integer
type
:
types
){
resourcePageNavigationDao
.
deleteNavigation
(
resourcePageId
,
type
);
}
}
/**
* 添加
书友社区导航
* 添加
小程序默认导航(互助、打卡)
* @author:zhuyajie
* @date:2021/8/16 14:39
* * @param null
*/
private
void
addDefaultAppletQANavigation
(
Long
resourcePageId
)
{
ResourcePageNavigation
resourcePageNavigation
=
resourcePageNavigationDao
.
getByType
(
resourcePageId
,
ResourcePageConstants
.
NavigationTypeEnum
.
APPLET_QA
.
getCode
());
if
(
null
!=
resourcePageNavigation
)
{
return
;
}
private
void
addDefaultAppletNavigation
(
Long
resourcePageId
)
{
ResourcePage
resourcePage
=
resourcePageDao
.
getById
(
resourcePageId
);
if
(
null
==
resourcePage
)
{
return
;
}
//书友互助、阅读打卡
List
<
Integer
>
types
=
ResourcePageConstants
.
APPLET_DEFAULT_NAVIGATIONS
;
Integer
maxSeq
=
resourcePageNavigationDao
.
getMaxSeq
(
resourcePageId
);
ResourcePageNavigation
navigation
=
new
ResourcePageNavigation
();
navigation
.
setCreateUser
(
resourcePage
.
getCreateUser
());
navigation
.
setNavigationName
(
ResourcePageConstants
.
NavigationTypeEnum
.
APPLET_QA
.
getName
());
navigation
.
setNavigationSeq
(
maxSeq
+
1
);
navigation
.
setNavigationType
(
ResourcePageConstants
.
NavigationTypeEnum
.
APPLET_QA
.
getCode
());
navigation
.
setResourcePageId
(
resourcePageId
);
resourcePageNavigationDao
.
insert
(
navigation
);
Integer
addSeq
=
0
;
List
<
ResourcePageNavigation
>
navigations
=
new
ArrayList
<>();
for
(
Integer
type
:
types
){
ResourcePageNavigation
resourcePageNavigation
=
resourcePageNavigationDao
.
getByType
(
resourcePageId
,
type
);
if
(
null
!=
resourcePageNavigation
)
{
continue
;
}
addSeq
=
addSeq
+
1
;
ResourcePageNavigation
navigation
=
new
ResourcePageNavigation
();
navigation
.
setCreateUser
(
resourcePage
.
getCreateUser
());
navigation
.
setNavigationName
(
ResourcePageConstants
.
NavigationTypeEnum
.
getNameByCode
(
type
));
navigation
.
setNavigationSeq
(
maxSeq
+
addSeq
);
navigation
.
setNavigationType
(
type
);
navigation
.
setResourcePageId
(
resourcePageId
);
navigations
.
add
(
navigation
);
}
if
(!
ListUtils
.
isEmpty
(
navigations
))
{
resourcePageNavigationDao
.
insert
(
navigations
);
}
}
/**
...
...
@@ -2357,4 +2364,17 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
paramMap
.
put
(
"type"
,
1
);
return
resourcePagePicDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
paramMap
,
"getByType"
);
}
@Override
public
void
batchUpdateColumnSeq
(
List
<
Long
>
navigationIds
)
{
if
(
ListUtils
.
isEmpty
(
navigationIds
))
{
return
;
}
for
(
Long
navigationId:
navigationIds
){
ResourcePageNavigation
navigation
=
resourcePageNavigationDao
.
getById
(
navigationId
);
if
(
null
!=
navigation
)
{
this
.
updateSeq4Batch
(
navigation
.
getResourcePageId
(),
navigationId
);
}
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/constant/ResourcePageConstants.java
View file @
fa563b2e
...
...
@@ -337,8 +337,9 @@ public class ResourcePageConstants {
*/
public
enum
NavigationTypeEnum
{
BOOK_SERVE
(
1
,
"本书配套"
),
APPLET_QA
(
2
,
"书友社区"
),
CUSTOM
(
3
,
"自定义"
);
APPLET_QA
(
2
,
"书友互助"
),
CUSTOM
(
3
,
"自定义"
),
CLOCK
(
4
,
"阅读打卡"
);
private
Integer
code
;
private
String
name
;
...
...
@@ -362,5 +363,18 @@ public class ResourcePageConstants {
this
.
code
=
code
;
this
.
name
=
name
;
}
public
static
String
getNameByCode
(
Integer
code
)
{
for
(
NavigationTypeEnum
navigationTypeEnum:
NavigationTypeEnum
.
values
()){
if
(
navigationTypeEnum
.
code
.
equals
(
code
)){
return
navigationTypeEnum
.
name
;
}
}
return
null
;
}
}
//小程序默认导航,书友互助、阅读打卡
public
static
List
<
Integer
>
APPLET_DEFAULT_NAVIGATIONS
=
Arrays
.
asList
(
ResourcePageConstants
.
NavigationTypeEnum
.
APPLET_QA
.
getCode
(),
ResourcePageConstants
.
NavigationTypeEnum
.
CLOCK
.
getCode
());
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/ResourcePageColumnDao.java
View file @
fa563b2e
...
...
@@ -53,7 +53,7 @@ public interface ResourcePageColumnDao extends BaseDao<ResourcePageColumn> {
* @date:2021/4/2 16:18
* * @param null
*/
ResourcePageColumn
getColumByMoveType
(
String
moveType
,
Long
resourcePageId
,
Integer
columnSeq
);
ResourcePageColumn
getColumByMoveType
(
String
moveType
,
Long
resourcePageId
,
Integer
columnSeq
,
Long
navigationId
);
/**
* 批量更新序号
* @author:zhuyajie
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/impl/ResourcePageColumnDaoImpl.java
View file @
fa563b2e
...
...
@@ -53,11 +53,12 @@ public class ResourcePageColumnDaoImpl extends BaseDaoImpl<ResourcePageColumn> i
}
@Override
public
ResourcePageColumn
getColumByMoveType
(
String
moveType
,
Long
resourcePageId
,
Integer
columnSeq
)
{
public
ResourcePageColumn
getColumByMoveType
(
String
moveType
,
Long
resourcePageId
,
Integer
columnSeq
,
Long
navigationId
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"moveType"
,
moveType
);
map
.
put
(
"resourcePageId"
,
resourcePageId
);
map
.
put
(
"columnSeq"
,
columnSeq
);
map
.
put
(
"navigationId"
,
navigationId
);
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getColumByMoveType"
),
map
);
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/facade/impl/ResourcePageFacade.java
View file @
fa563b2e
...
...
@@ -283,13 +283,6 @@ public class ResourcePageFacade {
return
new
ResponseDto
<>();
}
@ApiOperation
(
"处理旧数据导航"
)
@GetMapping
(
"dealOldNavigation"
)
public
ResponseDto
<?>
dealOldNavigation
()
{
resourcePageBiz
.
dealOldNavigation
();
return
new
ResponseDto
<>();
}
@ApiOperation
(
"保存导航"
)
@PostMapping
(
"saveNavigation"
)
public
ResponseDto
<?>
saveNavigation
(
@RequestHeader
(
"token"
)
String
token
,
...
...
@@ -327,4 +320,11 @@ public class ResourcePageFacade {
Long
partyId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
return
new
ResponseDto
<>(
resourcePageBiz
.
listNavigationPic
(
partyId
,
currentPage
,
numPerPage
));
}
@ApiOperation
(
"栏目重新排序"
)
@PostMapping
(
"batchUpdateColumnSeq"
)
public
ResponseDto
<?>
batchUpdateColumnSeq
(
@RequestBody
List
<
Long
>
navigationIds
)
{
resourcePageBiz
.
batchUpdateColumnSeq
(
navigationIds
);
return
new
ResponseDto
<>();
}
}
pcloud-service-book/src/main/resources/mapper/copyright/BookAuthInfo.Mapper.xml
View file @
fa563b2e
...
...
@@ -14,23 +14,24 @@
<result
column=
"BOOK_STATUS"
property=
"bookStatus"
jdbcType=
"TINYINT"
/>
<result
column=
"check_type"
property=
"checkType"
jdbcType=
"TINYINT"
/>
<result
column=
"is_authorized_pay"
property=
"isAuthorizedPay"
jdbcType=
"TINYINT"
/>
<result
column=
"open_pay"
property=
"openPay"
jdbcType=
"TINYINT"
/>
</resultMap>
<insert
id=
"insert"
useGeneratedKeys=
"true"
parameterType=
"bookAuthInfo"
>
INSERT INTO BOOK_AUTH_INFO(
BOOK_ID, CHANNEL_ID,ADVISER_ID,PRICE,CODE_USE_COUNT,BUY_URL,CHECK_TYPE, CREATED_USER, CREATED_DATE,LAST_MODIFIED_DATE,OPEN_TIME,
is_paper_book, is_group_book, is_authorized_pay
is_paper_book, is_group_book, is_authorized_pay
, open_pay
)
VALUES
(#{bookId,jdbcType=BIGINT}, #{channelId,jdbcType=BIGINT}, #{adviserId,jdbcType=BIGINT},
#{price}, #{codeUseCount,jdbcType=BIGINT}, #{buyUrl}, #{checkType},
#{adviserId,jdbcType=BIGINT}, NOW(), NOW(), NOW(),
#{isPaperBook}, #{isGroupBook}, IFNULL(#{isAuthorizedPay},0))
#{isPaperBook}, #{isGroupBook}, IFNULL(#{isAuthorizedPay},0)
, IFNULL(#{openPay},1)
)
</insert>
<select
id=
"getInfoByBook"
resultMap=
"BookAuthInfoMap"
parameterType=
"map"
>
SELECT
ID, BOOK_ID, CHANNEL_ID,ADVISER_ID,PRICE,CODE_USE_COUNT,BUY_URL,CHECK_TYPE,BOOK_STATUS,LOCATION_DESC, is_authorized_pay
ID, BOOK_ID, CHANNEL_ID,ADVISER_ID,PRICE,CODE_USE_COUNT,BUY_URL,CHECK_TYPE,BOOK_STATUS,LOCATION_DESC, is_authorized_pay
, open_pay
FROM
BOOK_AUTH_INFO
WHERE
...
...
@@ -267,6 +268,9 @@
<if
test=
"isAuthorizedPay != null"
>
is_authorized_pay = #{isAuthorizedPay},
</if>
<if
test=
"openPay != null"
>
open_pay = #{openPay},
</if>
LAST_MODIFIED_DATE = NOW()
WHERE
ID = #{id}
...
...
pcloud-service-book/src/main/resources/mapper/group/ResourcePageColumnDao.xml
View file @
fa563b2e
...
...
@@ -140,6 +140,7 @@
book.resource_page_column
WHERE
resource_page_id = #{resourcePageId}
AND navigation_id = #{navigationId}
<choose>
<when
test=
"moveType == 'UP'"
>
AND column_seq
<
#{columnSeq}
...
...
pcloud-service-book/src/main/resources/mapper/group/ResourcePageDao.xml
View file @
fa563b2e
...
...
@@ -106,7 +106,9 @@
p.open_rays,
p.open_food,
p.scene_id,
p.background_img
p.background_img,
p.navigation_color,
p.navigation_format
FROM
resource_page p
LEFT JOIN resource_page_item i ON p.id = i.resource_page_id
...
...
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