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
16daa14f
Commit
16daa14f
authored
Aug 26, 2022
by
郑勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: [1008097] 编辑运营优化(视频课、版权保护码、素材管理、做书数据、题库、图书配置、公众号资源配置)
parent
b8420491
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
53 additions
and
9 deletions
+53
-9
BookAuthCodeBizImpl.java
...m/pcloud/book/copyright/biz/impl/BookAuthCodeBizImpl.java
+6
-1
BookAuthInfoBizImpl.java
...m/pcloud/book/copyright/biz/impl/BookAuthInfoBizImpl.java
+23
-5
BookAuthInfo.java
...n/java/com/pcloud/book/copyright/entity/BookAuthInfo.java
+3
-0
CopyrightTools.java
.../java/com/pcloud/book/copyright/tools/CopyrightTools.java
+8
-0
BookAuthInfoVO.java
...ain/java/com/pcloud/book/copyright/vo/BookAuthInfoVO.java
+3
-0
SetAuthOpenParam.java
...n/java/com/pcloud/book/copyright/vo/SetAuthOpenParam.java
+3
-0
BookAuthInfo.Mapper.xml
...c/main/resources/mapper/copyright/BookAuthInfo.Mapper.xml
+7
-3
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/copyright/biz/impl/BookAuthCodeBizImpl.java
View file @
16daa14f
...
@@ -252,11 +252,16 @@ public class BookAuthCodeBizImpl implements BookAuthCodeBiz {
...
@@ -252,11 +252,16 @@ public class BookAuthCodeBizImpl implements BookAuthCodeBiz {
bookAuthCode
.
setAdviserId
(
adviserId
);
bookAuthCode
.
setAdviserId
(
adviserId
);
String
fullCode
=
data
[
i
][
1
];
String
fullCode
=
data
[
i
][
1
];
bookAuthCode
.
setFullCode
(
fullCode
);
bookAuthCode
.
setFullCode
(
fullCode
);
if
(
fullCode
==
null
||
fullCode
.
length
()
<
15
)
{
//feat:1008097 因为加入了可以导入10位纯数字。所以限制放改成10
if
(
fullCode
==
null
||
fullCode
.
length
()
<
10
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"授权码错误"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"授权码错误"
);
}
}
bookAuthCode
.
setBatchNum
(
fullCode
.
substring
(
0
,
4
));
bookAuthCode
.
setBatchNum
(
fullCode
.
substring
(
0
,
4
));
bookAuthCode
.
setAuthCode
(
fullCode
.
substring
(
4
,
data
[
i
][
1
].
length
()));
bookAuthCode
.
setAuthCode
(
fullCode
.
substring
(
4
,
data
[
i
][
1
].
length
()));
if
(
fullCode
.
length
()==
10
){
bookAuthCode
.
setBatchNum
(
fullCode
.
substring
(
0
,
2
));
bookAuthCode
.
setAuthCode
(
fullCode
.
substring
(
2
,
data
[
i
][
1
].
length
()));
}
bookAuthCode
.
setUseCount
(
0
);
bookAuthCode
.
setUseCount
(
0
);
bookAuthCode
.
setCreateType
(
1
);
bookAuthCode
.
setCreateType
(
1
);
bookAuthCode
.
setCreatedUser
(
adviserId
);
bookAuthCode
.
setCreatedUser
(
adviserId
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/copyright/biz/impl/BookAuthInfoBizImpl.java
View file @
16daa14f
...
@@ -140,7 +140,7 @@ public class BookAuthInfoBizImpl implements BookAuthInfoBiz {
...
@@ -140,7 +140,7 @@ public class BookAuthInfoBizImpl implements BookAuthInfoBiz {
bookAuthServeBiz
.
setBookAuthServes
(
setAuthOpenParam
.
getServes
(),
setAuthOpenParam
.
getBookId
(),
setAuthOpenParam
.
getChannelId
(),
adviserId
);
bookAuthServeBiz
.
setBookAuthServes
(
setAuthOpenParam
.
getServes
(),
setAuthOpenParam
.
getBookId
(),
setAuthOpenParam
.
getChannelId
(),
adviserId
);
}
}
//异步生成条形码并导出
//异步生成条形码并导出
asynExport
(
setAuthOpenParam
.
getBookId
(),
setAuthOpenParam
.
getChannelId
(),
adviserId
,
setAuthOpenParam
.
getCodeCount
(),
setAuthOpenParam
.
getIsHaveBarCode
(),
setAuthOpenParam
.
getAuthBookType
());
asynExport
(
setAuthOpenParam
.
getBookId
(),
setAuthOpenParam
.
getChannelId
(),
adviserId
,
setAuthOpenParam
.
getCodeCount
(),
setAuthOpenParam
.
getIsHaveBarCode
(),
setAuthOpenParam
.
getAuthBookType
()
,
setAuthOpenParam
.
getCodeComposeType
()
);
Integer
authBookType
=
setAuthOpenParam
.
getAuthBookType
()
==
null
?
0
:
setAuthOpenParam
.
getAuthBookType
();
Integer
authBookType
=
setAuthOpenParam
.
getAuthBookType
()
==
null
?
0
:
setAuthOpenParam
.
getAuthBookType
();
String
key
=
CopyrightConstants
.
BOOK_AUTH_INFO
+
bookAuthInfo
.
getBookId
()
+
"-"
+
bookAuthInfo
.
getChannelId
()
+
"-"
+
adviserId
+
"-"
+
authBookType
;
String
key
=
CopyrightConstants
.
BOOK_AUTH_INFO
+
bookAuthInfo
.
getBookId
()
+
"-"
+
bookAuthInfo
.
getChannelId
()
+
"-"
+
adviserId
+
"-"
+
authBookType
;
BookAuthInfoVO
bookAuth
=
bookAuthInfoDao
.
getInfoByBook
(
setAuthOpenParam
.
getBookId
(),
setAuthOpenParam
.
getChannelId
(),
adviserId
,
setAuthOpenParam
.
getAuthBookType
());
BookAuthInfoVO
bookAuth
=
bookAuthInfoDao
.
getInfoByBook
(
setAuthOpenParam
.
getBookId
(),
setAuthOpenParam
.
getChannelId
(),
adviserId
,
setAuthOpenParam
.
getAuthBookType
());
...
@@ -162,7 +162,18 @@ public class BookAuthInfoBizImpl implements BookAuthInfoBiz {
...
@@ -162,7 +162,18 @@ public class BookAuthInfoBizImpl implements BookAuthInfoBiz {
}
}
@ParamLog
(
"异步导出"
)
@ParamLog
(
"异步导出"
)
private
void
asynExport
(
Long
bookId
,
Long
channelId
,
Long
adviserId
,
Integer
codeCount
,
Integer
isHaveBarCode
,
Integer
authBookType
)
{
private
void
asynExport
(
Long
bookId
,
Long
channelId
,
Long
adviserId
,
Integer
codeCount
,
Integer
isHaveBarCode
,
Integer
authBookType
,
Integer
codeComposeType
)
{
//获取批次号
Integer
batchNum
=
bookAuthCodeBiz
.
getMaxBatchNum
(
bookId
,
channelId
,
adviserId
,
authBookType
);
if
(
null
!=
codeComposeType
&&
codeComposeType
==
2
){
if
(
batchNum
>
99
){
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"生成授权码已经超过最大次数了!"
);
}
}
else
{
if
(
batchNum
>
9999
){
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"生成授权码已经超过最大次数了!"
);
}
}
ThreadPoolUtils
.
EXPORT_THREAD_POOL
.
execute
(()
->
{
ThreadPoolUtils
.
EXPORT_THREAD_POOL
.
execute
(()
->
{
String
commitTime
=
DateUtils
.
formatDate
(
new
Date
());
String
commitTime
=
DateUtils
.
formatDate
(
new
Date
());
String
num
=
""
;
String
num
=
""
;
...
@@ -170,9 +181,11 @@ public class BookAuthInfoBizImpl implements BookAuthInfoBiz {
...
@@ -170,9 +181,11 @@ public class BookAuthInfoBizImpl implements BookAuthInfoBiz {
if
(
codeCount
==
null
||
codeCount
==
0
)
{
if
(
codeCount
==
null
||
codeCount
==
0
)
{
return
;
return
;
}
}
//获取批次号
// TODO
Integer
batchNum
=
bookAuthCodeBiz
.
getMaxBatchNum
(
bookId
,
channelId
,
adviserId
,
authBookType
);
// TODO
num
=
String
.
format
(
"%04d"
,
batchNum
);
num
=
String
.
format
(
"%04d"
,
batchNum
);
if
(
null
!=
codeComposeType
&&
codeComposeType
==
2
){
num
=
String
.
format
(
"%02d"
,
batchNum
);
}
//新增导出记录
//新增导出记录
insertExportRecord
(
bookId
,
channelId
,
adviserId
,
num
,
codeCount
,
isHaveBarCode
);
insertExportRecord
(
bookId
,
channelId
,
adviserId
,
num
,
codeCount
,
isHaveBarCode
);
//获取图书名称
//获取图书名称
...
@@ -181,7 +194,12 @@ public class BookAuthInfoBizImpl implements BookAuthInfoBiz {
...
@@ -181,7 +194,12 @@ public class BookAuthInfoBizImpl implements BookAuthInfoBiz {
return
;
return
;
}
}
//获取随机数
//获取随机数
List
<
String
>
uuids
=
CopyrightTools
.
createShortUuidByCount
(
codeCount
);
List
<
String
>
uuids
=
new
ArrayList
<>();
if
(
null
!=
codeComposeType
&&
codeComposeType
==
2
){
uuids
=
CopyrightTools
.
createShortNumberByCount
(
codeCount
);
}
else
{
uuids
=
CopyrightTools
.
createShortUuidByCount
(
codeCount
);
}
List
<
BookAuthCode
>
bookAuthCodes
=
new
ArrayList
<>();
List
<
BookAuthCode
>
bookAuthCodes
=
new
ArrayList
<>();
for
(
String
uuid
:
uuids
)
{
for
(
String
uuid
:
uuids
)
{
BookAuthCode
bookAuthCode
=
new
BookAuthCode
();
BookAuthCode
bookAuthCode
=
new
BookAuthCode
();
...
...
pcloud-service-book/src/main/java/com/pcloud/book/copyright/entity/BookAuthInfo.java
View file @
16daa14f
...
@@ -77,4 +77,7 @@ public class BookAuthInfo extends BaseEntity {
...
@@ -77,4 +77,7 @@ public class BookAuthInfo extends BaseEntity {
@ApiModelProperty
(
"授权类型(1-旧版-二维码+授权码,2-升级,二维码)"
)
@ApiModelProperty
(
"授权类型(1-旧版-二维码+授权码,2-升级,二维码)"
)
private
Integer
authType
;
private
Integer
authType
;
@ApiModelProperty
(
"授权码组成;1-15位字母+数字,2-10位纯数字"
)
private
Integer
codeComposeType
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/copyright/tools/CopyrightTools.java
View file @
16daa14f
...
@@ -98,6 +98,14 @@ public class CopyrightTools {
...
@@ -98,6 +98,14 @@ public class CopyrightTools {
return
new
ArrayList
<>(
numbers
);
return
new
ArrayList
<>(
numbers
);
}
}
public
static
List
<
String
>
createShortNumberByCount
(
Integer
count
)
{
Set
<
String
>
numbers
=
new
HashSet
<>(
count
);
while
(
numbers
.
size
()
<
count
)
{
numbers
.
add
(
RandomUtil
.
randomString
(
"0123456789"
,
8
));
}
return
new
ArrayList
<>(
numbers
);
}
public
static
String
generateBarCode128Local
(
String
strBarCode
,
String
dimension
,
String
barheight
)
{
public
static
String
generateBarCode128Local
(
String
strBarCode
,
String
dimension
,
String
barheight
)
{
try
{
try
{
...
...
pcloud-service-book/src/main/java/com/pcloud/book/copyright/vo/BookAuthInfoVO.java
View file @
16daa14f
...
@@ -56,4 +56,7 @@ public class BookAuthInfoVO implements Serializable {
...
@@ -56,4 +56,7 @@ public class BookAuthInfoVO implements Serializable {
@ApiModelProperty
(
"授权类型(1-旧版-二维码+授权码,2-升级,二维码)"
)
@ApiModelProperty
(
"授权类型(1-旧版-二维码+授权码,2-升级,二维码)"
)
private
Integer
authType
;
private
Integer
authType
;
@ApiModelProperty
(
"授权码组成;1-15位字母+数字,2-10位纯数字"
)
private
Integer
codeComposeType
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/copyright/vo/SetAuthOpenParam.java
View file @
16daa14f
...
@@ -57,4 +57,7 @@ public class SetAuthOpenParam implements Serializable {
...
@@ -57,4 +57,7 @@ public class SetAuthOpenParam implements Serializable {
@ApiModelProperty
(
"打开支付功能;0:关闭;1:开启;"
)
@ApiModelProperty
(
"打开支付功能;0:关闭;1:开启;"
)
private
Integer
openPay
;
private
Integer
openPay
;
@ApiModelProperty
(
"授权码组成;1-15位字母+数字,2-10位纯数字"
)
private
Integer
codeComposeType
;
}
}
pcloud-service-book/src/main/resources/mapper/copyright/BookAuthInfo.Mapper.xml
View file @
16daa14f
...
@@ -16,23 +16,24 @@
...
@@ -16,23 +16,24 @@
<result
column=
"is_authorized_pay"
property=
"isAuthorizedPay"
jdbcType=
"TINYINT"
/>
<result
column=
"is_authorized_pay"
property=
"isAuthorizedPay"
jdbcType=
"TINYINT"
/>
<result
column=
"open_pay"
property=
"openPay"
jdbcType=
"TINYINT"
/>
<result
column=
"open_pay"
property=
"openPay"
jdbcType=
"TINYINT"
/>
<result
column=
"auth_type"
property=
"authType"
jdbcType=
"TINYINT"
/>
<result
column=
"auth_type"
property=
"authType"
jdbcType=
"TINYINT"
/>
<result
column=
"code_compose_type"
property=
"codeComposeType"
jdbcType=
"TINYINT"
/>
</resultMap>
</resultMap>
<insert
id=
"insert"
useGeneratedKeys=
"true"
parameterType=
"bookAuthInfo"
>
<insert
id=
"insert"
useGeneratedKeys=
"true"
parameterType=
"bookAuthInfo"
>
INSERT INTO BOOK_AUTH_INFO(
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,
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, open_pay,auth_type
is_paper_book, is_group_book, is_authorized_pay, open_pay,auth_type
,code_compose_type
)
)
VALUES
VALUES
(#{bookId,jdbcType=BIGINT}, #{channelId,jdbcType=BIGINT}, #{adviserId,jdbcType=BIGINT},
(#{bookId,jdbcType=BIGINT}, #{channelId,jdbcType=BIGINT}, #{adviserId,jdbcType=BIGINT},
#{price}, #{codeUseCount,jdbcType=BIGINT}, #{buyUrl}, #{checkType},
#{price}, #{codeUseCount,jdbcType=BIGINT}, #{buyUrl}, #{checkType},
#{adviserId,jdbcType=BIGINT}, NOW(), NOW(), NOW(),
#{adviserId,jdbcType=BIGINT}, NOW(), NOW(), NOW(),
#{isPaperBook}, #{isGroupBook}, IFNULL(#{isAuthorizedPay},0), IFNULL(#{openPay},1),IFNULL(#{authType},1))
#{isPaperBook}, #{isGroupBook}, IFNULL(#{isAuthorizedPay},0), IFNULL(#{openPay},1),IFNULL(#{authType},1)
,#{codeComposeType}
)
</insert>
</insert>
<select
id=
"getInfoByBook"
resultMap=
"BookAuthInfoMap"
parameterType=
"map"
>
<select
id=
"getInfoByBook"
resultMap=
"BookAuthInfoMap"
parameterType=
"map"
>
SELECT
SELECT
ID, BOOK_ID, CHANNEL_ID,ADVISER_ID,PRICE,CODE_USE_COUNT,BUY_URL,CHECK_TYPE,BOOK_STATUS,LOCATION_DESC, is_authorized_pay, open_pay,auth_type
ID, BOOK_ID, CHANNEL_ID,ADVISER_ID,PRICE,CODE_USE_COUNT,BUY_URL,CHECK_TYPE,BOOK_STATUS,LOCATION_DESC, is_authorized_pay, open_pay,auth_type
,code_compose_type
FROM
FROM
BOOK_AUTH_INFO
BOOK_AUTH_INFO
WHERE
WHERE
...
@@ -276,6 +277,9 @@
...
@@ -276,6 +277,9 @@
<if
test=
"authType != null"
>
<if
test=
"authType != null"
>
auth_type = #{authType},
auth_type = #{authType},
</if>
</if>
<if
test=
"codeComposeType != null"
>
code_compose_type = #{codeComposeType},
</if>
LAST_MODIFIED_DATE = NOW()
LAST_MODIFIED_DATE = NOW()
WHERE
WHERE
ID = #{id}
ID = #{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