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
cc750eb7
Commit
cc750eb7
authored
Feb 02, 2023
by
zx1234zxcv2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat[1009521] 版权保护新增时间段搜索&&导出筛选的全部数据
parent
304d71a1
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
133 additions
and
3 deletions
+133
-3
BookAuthCodeBiz.java
...n/java/com/pcloud/book/copyright/biz/BookAuthCodeBiz.java
+10
-1
BookAuthCodeBizImpl.java
...m/pcloud/book/copyright/biz/impl/BookAuthCodeBizImpl.java
+18
-1
BookAuthCodeDao.java
...n/java/com/pcloud/book/copyright/dao/BookAuthCodeDao.java
+2
-0
BookAuthCodeDaoImpl.java
...m/pcloud/book/copyright/dao/impl/BookAuthCodeDaoImpl.java
+21
-0
BookAuthCodeFacade.java
.../com/pcloud/book/copyright/facade/BookAuthCodeFacade.java
+14
-0
BookAuthCodeFacadeImpl.java
...ud/book/copyright/facade/impl/BookAuthCodeFacadeImpl.java
+23
-1
BookAuthCode.Mapper.xml
...c/main/resources/mapper/copyright/BookAuthCode.Mapper.xml
+45
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/copyright/biz/BookAuthCodeBiz.java
View file @
cc750eb7
...
...
@@ -59,14 +59,18 @@ public interface BookAuthCodeBiz {
/**
* 获取正版授权码
*
* @param dateList
* @param bookId
* @param channelId
* @param keyword
* @param state
* @param pageParam
* @param startDate
* @param endDate
* @return
*/
PageBeanNew
<
BookAuthCodeDTO
>
getCodeList
(
Long
bookId
,
Long
channelId
,
Long
adviserId
,
String
keyword
,
Integer
state
,
Integer
authBookType
,
PageParam
pageParam
);
PageBeanNew
<
BookAuthCodeDTO
>
getCodeList
(
Long
bookId
,
Long
channelId
,
Long
adviserId
,
String
keyword
,
Integer
state
,
Integer
authBookType
,
PageParam
pageParam
,
String
startDate
,
String
endDate
);
/**
* 批量删除正版授权码
...
...
@@ -102,4 +106,9 @@ public interface BookAuthCodeBiz {
* @Date 16:27 2021/12/13
**/
void
clearAuthCodeUser
(
Long
adviserId
,
String
fullCode
,
Long
bookId
);
/**
* 导出筛选后的全部数据
*/
Map
<
String
,
Object
>
getQueryCodeExcel
(
Long
bookId
,
Long
channelId
,
Long
adviserId
,
String
keyword
,
Integer
state
,
Integer
authBookType
,
String
startDate
,
String
endDate
,
String
systemCode
);
}
pcloud-service-book/src/main/java/com/pcloud/book/copyright/biz/impl/BookAuthCodeBizImpl.java
View file @
cc750eb7
...
...
@@ -343,22 +343,28 @@ public class BookAuthCodeBizImpl implements BookAuthCodeBiz {
/**
* 获取正版授权码
*
* @param dateList
* @param bookId
* @param channelId
* @param keyword
* @param state
* @param pageParam
* @param startDate
* @param endDate
* @return
*/
@Override
@ParamLog
(
"获取正版授权码"
)
public
PageBeanNew
<
BookAuthCodeDTO
>
getCodeList
(
Long
bookId
,
Long
channelId
,
Long
adviserId
,
String
keyword
,
Integer
state
,
Integer
authBookType
,
PageParam
pageParam
)
{
public
PageBeanNew
<
BookAuthCodeDTO
>
getCodeList
(
Long
bookId
,
Long
channelId
,
Long
adviserId
,
String
keyword
,
Integer
state
,
Integer
authBookType
,
PageParam
pageParam
,
String
startDate
,
String
endDate
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"bookId"
,
bookId
);
paramMap
.
put
(
"channelId"
,
channelId
);
paramMap
.
put
(
"adviserId"
,
adviserId
);
paramMap
.
put
(
"keyword"
,
StringUtil
.
isEmpty
(
keyword
)?
null
:
keyword
);
paramMap
.
put
(
"state"
,
state
);
paramMap
.
put
(
"startDate"
,
StringUtil
.
isEmpty
(
startDate
)?
null
:
startDate
);
paramMap
.
put
(
"endDate"
,
StringUtil
.
isEmpty
(
endDate
)?
null
:
endDate
);
if
(
null
==
authBookType
||
AuthBookTypeEnum
.
PAPER_BOOK
.
value
.
equals
(
authBookType
)){
paramMap
.
put
(
"isPaperBook"
,
1
);
}
else
{
...
...
@@ -690,4 +696,15 @@ public class BookAuthCodeBizImpl implements BookAuthCodeBiz {
}
bookAuthCodeDao
.
clearUseCount
(
bookAuthCode
.
getId
());
}
@Override
public
Map
<
String
,
Object
>
getQueryCodeExcel
(
Long
bookId
,
Long
channelId
,
Long
adviserId
,
String
keyword
,
Integer
state
,
Integer
authBookType
,
String
startDate
,
String
endDate
,
String
systemCode
)
{
List
<
Long
>
idList
=
bookAuthCodeDao
.
getQueryCodeIdList
(
bookId
,
channelId
,
adviserId
,
keyword
,
authBookType
,
startDate
,
endDate
,
state
);
if
(
CollUtil
.
isEmpty
(
idList
))
{
throw
new
BookBizException
(
BookBizException
.
ID_NOT_EXIST
,
"没有需要导出的授权码!"
);
}
String
ids
=
idList
.
stream
().
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
));
Map
<
String
,
Object
>
map
=
getCodeExcel
(
bookId
,
ids
,
channelId
,
1L
,
systemCode
,
adviserId
,
authBookType
);
return
map
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/copyright/dao/BookAuthCodeDao.java
View file @
cc750eb7
...
...
@@ -69,4 +69,6 @@ public interface BookAuthCodeDao extends BaseDao<BookAuthCode> {
void
deleteCode
(
Long
id
);
Integer
updateUseCountById
(
Long
authCodeId
,
Integer
codeUseCount
,
Long
adviserId
);
List
<
Long
>
getQueryCodeIdList
(
Long
bookId
,
Long
channelId
,
Long
adviserId
,
String
keyWord
,
Integer
authBookType
,
String
startDate
,
String
endDate
,
Integer
state
);
}
pcloud-service-book/src/main/java/com/pcloud/book/copyright/dao/impl/BookAuthCodeDaoImpl.java
View file @
cc750eb7
...
...
@@ -6,8 +6,10 @@ import com.pcloud.book.copyright.dao.BookAuthCodeDao;
import
com.pcloud.book.copyright.dto.BookAuthCodeDTO
;
import
com.pcloud.book.copyright.entity.BookAuthCode
;
import
com.pcloud.book.copyright.dto.HaveUsedAuthCode
;
import
com.pcloud.book.copyright.enums.AuthBookTypeEnum
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
com.pcloud.common.utils.string.StringUtil
;
import
org.springframework.stereotype.Component
;
import
java.util.HashMap
;
...
...
@@ -144,4 +146,23 @@ public class BookAuthCodeDaoImpl extends BaseDaoImpl<BookAuthCode> implements Bo
paramMap
.
put
(
"adviserId"
,
Optional
.
ofNullable
(
adviserId
).
orElse
(
0L
));
return
getSqlSession
().
update
(
getStatement
(
"updateUseCountById"
),
paramMap
);
}
@Override
public
List
<
Long
>
getQueryCodeIdList
(
Long
bookId
,
Long
channelId
,
Long
adviserId
,
String
keyWord
,
Integer
authBookType
,
String
startDate
,
String
endDate
,
Integer
state
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"bookId"
,
bookId
);
paramMap
.
put
(
"channelId"
,
channelId
);
paramMap
.
put
(
"adviserId"
,
adviserId
);
paramMap
.
put
(
"keyword"
,
StringUtil
.
isEmpty
(
keyWord
)?
null
:
keyWord
);
paramMap
.
put
(
"state"
,
state
);
paramMap
.
put
(
"startDate"
,
StringUtil
.
isEmpty
(
startDate
)?
null
:
startDate
);
paramMap
.
put
(
"endDate"
,
StringUtil
.
isEmpty
(
endDate
)?
null
:
endDate
);
if
(
null
==
authBookType
||
AuthBookTypeEnum
.
PAPER_BOOK
.
value
.
equals
(
authBookType
)){
paramMap
.
put
(
"isPaperBook"
,
1
);
}
else
{
paramMap
.
put
(
"isGroupBook"
,
1
);
}
return
this
.
getSqlSession
().
selectList
(
this
.
getStatement
(
"getQueryCodeIdList"
),
paramMap
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/copyright/facade/BookAuthCodeFacade.java
View file @
cc750eb7
...
...
@@ -62,6 +62,8 @@ public interface BookAuthCodeFacade {
@RequestParam
(
required
=
false
,
value
=
"keyword"
)
String
keyword
,
@RequestParam
(
required
=
false
,
value
=
"state"
)
Integer
state
,
@RequestParam
(
required
=
false
,
value
=
"authBookType"
)
Integer
authBookType
,
@RequestParam
(
required
=
false
,
value
=
"startDate"
)
String
startDate
,
@RequestParam
(
required
=
false
,
value
=
"endDate"
)
String
endDate
,
@RequestParam
(
"currentPage"
)
Integer
currentPage
,
@RequestParam
(
"numPerPage"
)
Integer
numPerPage
)
throws
PermissionException
,
BizException
;
...
...
@@ -102,4 +104,16 @@ public interface BookAuthCodeFacade {
@RequestParam
(
required
=
false
,
value
=
"authBookType"
)
Integer
authBookType
)
throws
PermissionException
,
JsonParseException
,
BizException
;
@ApiOperation
(
value
=
"导出筛选后的全部数据"
,
httpMethod
=
"GET"
)
@RequestMapping
(
value
=
"/exportQueryCode"
,
method
=
RequestMethod
.
GET
)
ResponseDto
<?>
exportQueryCode
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
"bookId"
)
Long
bookId
,
@RequestParam
(
"channelId"
)
Long
channelId
,
@RequestParam
(
required
=
false
,
value
=
"keyword"
)
String
keyword
,
@RequestParam
(
required
=
false
,
value
=
"state"
)
Integer
state
,
@RequestParam
(
required
=
false
,
value
=
"authBookType"
)
Integer
authBookType
,
@RequestParam
(
required
=
false
,
value
=
"startDate"
)
String
startDate
,
@RequestParam
(
required
=
false
,
value
=
"endDate"
)
String
endDate
)
throws
PermissionException
,
JsonParseException
,
BizException
;
}
pcloud-service-book/src/main/java/com/pcloud/book/copyright/facade/impl/BookAuthCodeFacadeImpl.java
View file @
cc750eb7
...
...
@@ -41,6 +41,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.Enumeration
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -118,6 +119,8 @@ public class BookAuthCodeFacadeImpl implements BookAuthCodeFacade {
@RequestParam
(
required
=
false
,
value
=
"keyword"
)
String
keyword
,
@RequestParam
(
required
=
false
,
value
=
"state"
)
Integer
state
,
@RequestParam
(
required
=
false
,
value
=
"authBookType"
)
Integer
authBookType
,
@RequestParam
(
required
=
false
,
value
=
"startDate"
)
String
startDate
,
@RequestParam
(
required
=
false
,
value
=
"endDate"
)
String
endDate
,
@RequestParam
(
required
=
false
,
value
=
"currentPage"
)
Integer
currentPage
,
@RequestParam
(
required
=
false
,
value
=
"numPerPage"
)
Integer
numPerPage
)
throws
PermissionException
,
BizException
{
Long
adviserId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
...
...
@@ -128,7 +131,7 @@ public class BookAuthCodeFacadeImpl implements BookAuthCodeFacade {
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数有误!"
);
}
PageParam
pageParam
=
new
PageParam
(
currentPage
,
numPerPage
);
return
new
ResponseDto
<>(
bookAuthCodeBiz
.
getCodeList
(
bookId
,
channelId
,
adviserId
,
keyword
,
state
,
authBookType
,
pageParam
));
return
new
ResponseDto
<>(
bookAuthCodeBiz
.
getCodeList
(
bookId
,
channelId
,
adviserId
,
keyword
,
state
,
authBookType
,
pageParam
,
startDate
,
endDate
));
}
/**
...
...
@@ -168,6 +171,25 @@ public class BookAuthCodeFacadeImpl implements BookAuthCodeFacade {
return
new
ResponseDto
<>(
map
);
}
@Override
@RequestMapping
(
value
=
"/exportQueryCode"
,
method
=
RequestMethod
.
GET
)
public
ResponseDto
<?>
exportQueryCode
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
required
=
false
,
value
=
"bookId"
)
Long
bookId
,
@RequestParam
(
required
=
false
,
value
=
"channelId"
)
Long
channelId
,
@RequestParam
(
required
=
false
,
value
=
"keyword"
)
String
keyword
,
@RequestParam
(
required
=
false
,
value
=
"state"
)
Integer
state
,
@RequestParam
(
required
=
false
,
value
=
"authBookType"
)
Integer
authBookType
,
@RequestParam
(
required
=
false
,
value
=
"startDate"
)
String
startDate
,
@RequestParam
(
required
=
false
,
value
=
"endDate"
)
String
endDate
)
throws
PermissionException
,
JsonParseException
,
BizException
{
String
systemCode
=
(
String
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
SYSTEM_CODE
);
Long
adviserId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
if
(
null
==
bookId
||
null
==
channelId
){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数有误!"
);
}
Map
<
String
,
Object
>
map
=
bookAuthCodeBiz
.
getQueryCodeExcel
(
bookId
,
channelId
,
adviserId
,
keyword
,
state
,
authBookType
,
startDate
,
endDate
,
systemCode
);
return
new
ResponseDto
<>(
map
);
}
/**
*一键删除未使用的授权码
*/
...
...
pcloud-service-book/src/main/resources/mapper/copyright/BookAuthCode.Mapper.xml
View file @
cc750eb7
...
...
@@ -149,6 +149,12 @@
AND
is_group_book = #{isGroupBook}
</if>
<if
test=
"startDate != null"
>
AND created_date
>
= #{startDate}
</if>
<if
test=
"endDate != null"
>
AND created_date
<
= #{endDate}
</if>
order by created_date desc
</select>
...
...
@@ -284,4 +290,43 @@
id = #{id, jdbcType=BIGINT}
AND use_count
<![CDATA[ < ]]>
#{codeUseCount}
</update>
<select
id=
"getQueryCodeIdList"
parameterType=
"map"
resultType=
"java.lang.Long"
>
SELECT
id
FROM
book_auth_code
WHERE
book_id = #{bookId}
AND channel_id = #{channelId}
AND adviser_id = #{adviserId}
<if
test=
"keyword != null"
>
AND full_code LIKE CONCAT('%', #{keyword}, '%')
</if>
<if
test=
"state != null"
>
<choose>
<when
test=
"state == 0"
>
and use_count = 0
</when>
<otherwise>
and use_count > 0
</otherwise>
</choose>
</if>
<if
test=
"isPaperBook != null"
>
AND
is_paper_book = #{isPaperBook}
</if>
<if
test=
"isGroupBook!=null"
>
AND
is_group_book = #{isGroupBook}
</if>
<if
test=
"startDate != null"
>
AND created_date
>
= #{startDate}
</if>
<if
test=
"endDate != null"
>
AND created_date
<
= #{endDate}
</if>
order by created_date desc
</select>
</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