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
8de659e6
Commit
8de659e6
authored
Feb 23, 2020
by
阮思源
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat-1002413' into 'master'
新标签 See merge request rays/pcloud-book!456
parents
755556cd
7c52b18a
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
113 additions
and
0 deletions
+113
-0
BookLabelDao.java
.../src/main/java/com/pcloud/book/book/dao/BookLabelDao.java
+2
-0
BookLabelDaoImpl.java
.../java/com/pcloud/book/book/dao/impl/BookLabelDaoImpl.java
+9
-0
BookGroupBiz.java
...src/main/java/com/pcloud/book/group/biz/BookGroupBiz.java
+5
-0
BookGroupBizImpl.java
...java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
+30
-0
BookGroupDao.java
...src/main/java/com/pcloud/book/group/dao/BookGroupDao.java
+5
-0
BookGroupDaoImpl.java
...java/com/pcloud/book/group/dao/impl/BookGroupDaoImpl.java
+21
-0
BookGroupFacade.java
...in/java/com/pcloud/book/group/facade/BookGroupFacade.java
+5
-0
BookGroupFacadeImpl.java
...om/pcloud/book/group/facade/impl/BookGroupFacadeImpl.java
+8
-0
BookLabel.Mapper.xml
...-book/src/main/resources/mapper/book/BookLabel.Mapper.xml
+8
-0
BookGroupMapper.xml
...-book/src/main/resources/mapper/group/BookGroupMapper.xml
+20
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/book/dao/BookLabelDao.java
View file @
8de659e6
...
@@ -13,4 +13,6 @@ public interface BookLabelDao extends BaseDao<BookLabel> {
...
@@ -13,4 +13,6 @@ public interface BookLabelDao extends BaseDao<BookLabel> {
List
<
BookLabel
>
getAll
();
List
<
BookLabel
>
getAll
();
Map
<
Long
,
BookLabel
>
getMapByIds
(
List
<
Long
>
list
);
Map
<
Long
,
BookLabel
>
getMapByIds
(
List
<
Long
>
list
);
Long
getByNameType
(
String
name
,
Integer
type
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/book/dao/impl/BookLabelDaoImpl.java
View file @
8de659e6
...
@@ -5,6 +5,7 @@ import com.pcloud.book.book.entity.BookLabel;
...
@@ -5,6 +5,7 @@ import com.pcloud.book.book.entity.BookLabel;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -31,4 +32,12 @@ public class BookLabelDaoImpl extends BaseDaoImpl<BookLabel> implements BookLabe
...
@@ -31,4 +32,12 @@ public class BookLabelDaoImpl extends BaseDaoImpl<BookLabel> implements BookLabe
public
Map
<
Long
,
BookLabel
>
getMapByIds
(
List
<
Long
>
list
)
{
public
Map
<
Long
,
BookLabel
>
getMapByIds
(
List
<
Long
>
list
)
{
return
super
.
getSqlSession
().
selectMap
(
super
.
getStatement
(
"getMapByIds"
),
list
,
"id"
);
return
super
.
getSqlSession
().
selectMap
(
super
.
getStatement
(
"getMapByIds"
),
list
,
"id"
);
}
}
@Override
public
Long
getByNameType
(
String
name
,
Integer
type
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
name
);
map
.
put
(
"type"
,
type
);
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getByNameType"
),
map
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/BookGroupBiz.java
View file @
8de659e6
...
@@ -766,4 +766,9 @@ public interface BookGroupBiz {
...
@@ -766,4 +766,9 @@ public interface BookGroupBiz {
* @return
* @return
*/
*/
PageBeanNew
<
UserBookInfoVO
>
listUser4ReadingActivity
(
UserSelectParamDTO
userSelectParamDTO
);
PageBeanNew
<
UserBookInfoVO
>
listUser4ReadingActivity
(
UserSelectParamDTO
userSelectParamDTO
);
/**
* 旧标签转换为新标签
*/
void
updateNewLabel
();
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
View file @
8de659e6
...
@@ -4392,4 +4392,34 @@ public class BookGroupBizImpl implements BookGroupBiz {
...
@@ -4392,4 +4392,34 @@ public class BookGroupBizImpl implements BookGroupBiz {
groupSet
.
setUserBookInfo4ReadingActivity
(
list
);
groupSet
.
setUserBookInfo4ReadingActivity
(
list
);
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
countlist
.
size
(),
list
);
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
countlist
.
size
(),
list
);
}
}
@Override
public
void
updateNewLabel
()
{
List
<
BookGroup
>
bookGroupList
=
bookGroupDao
.
listOldLabel
();
List
<
Long
>
labelIds
=
new
ArrayList
<>();
List
<
Long
>
proLabels
=
bookGroupList
.
stream
().
map
(
BookGroup:
:
getProLabelId
).
distinct
().
collect
(
Collectors
.
toList
());
List
<
Long
>
depLabels
=
bookGroupList
.
stream
().
map
(
BookGroup:
:
getDepLabelId
).
distinct
().
collect
(
Collectors
.
toList
());
labelIds
.
addAll
(
proLabels
);
labelIds
.
addAll
(
depLabels
);
if
(!
ListUtils
.
isEmpty
(
labelIds
))
{
Map
<
Long
,
String
>
labelMap
=
ResponseHandleUtil
.
parseMap
(
labelService
.
getLabelName
(
labelIds
),
Long
.
class
,
String
.
class
);
if
(!
MapUtils
.
isEmpty
(
labelMap
))
{
for
(
Long
proLebelId
:
proLabels
){
String
subject
=
labelMap
.
get
(
proLebelId
);
Long
subjectId
=
bookLabelDao
.
getByNameType
(
subject
,
2
);
if
(
null
!=
subjectId
){
bookGroupDao
.
updateSubjectByProLabel
(
proLebelId
,
subjectId
);
}
}
for
(
Long
depLabelId:
depLabels
){
String
grade
=
labelMap
.
get
(
depLabelId
);
Long
gradeId
=
bookLabelDao
.
getByNameType
(
grade
,
1
);
if
(
null
!=
gradeId
){
bookGroupDao
.
updateGradeByDepLabel
(
depLabelId
,
gradeId
);
}
}
}
}
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/BookGroupDao.java
View file @
8de659e6
...
@@ -303,4 +303,9 @@ public interface BookGroupDao extends BaseDao<BookGroup> {
...
@@ -303,4 +303,9 @@ public interface BookGroupDao extends BaseDao<BookGroup> {
* 根据书籍简称获取
* 根据书籍简称获取
*/
*/
BookGroup
getByShortBookName
(
String
shortBookName
);
BookGroup
getByShortBookName
(
String
shortBookName
);
List
<
BookGroup
>
listOldLabel
();
void
updateSubjectByProLabel
(
Long
proLebelId
,
Long
subjectId
);
void
updateGradeByDepLabel
(
Long
depLabelId
,
Long
graLabelId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/impl/BookGroupDaoImpl.java
View file @
8de659e6
...
@@ -341,4 +341,25 @@ public class BookGroupDaoImpl extends BaseDaoImpl<BookGroup> implements BookGrou
...
@@ -341,4 +341,25 @@ public class BookGroupDaoImpl extends BaseDaoImpl<BookGroup> implements BookGrou
public
BookGroup
getByShortBookName
(
String
shortBookName
)
{
public
BookGroup
getByShortBookName
(
String
shortBookName
)
{
return
super
.
getSqlSession
().
selectOne
(
getStatement
(
"getByShortBookName"
),
shortBookName
);
return
super
.
getSqlSession
().
selectOne
(
getStatement
(
"getByShortBookName"
),
shortBookName
);
}
}
@Override
public
List
<
BookGroup
>
listOldLabel
()
{
return
getSessionTemplate
().
selectList
(
getStatement
(
"listOldLabel"
));
}
@Override
public
void
updateSubjectByProLabel
(
Long
proLebelId
,
Long
subjectId
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"proLabelId"
,
proLebelId
);
map
.
put
(
"subLabelId"
,
subjectId
);
getSessionTemplate
().
update
(
getStatement
(
"updateSubjectByProLabel"
),
map
);
}
@Override
public
void
updateGradeByDepLabel
(
Long
depLabelId
,
Long
graLabelId
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"depLabelId"
,
depLabelId
);
map
.
put
(
"graLabelId"
,
graLabelId
);
getSessionTemplate
().
update
(
getStatement
(
"updateGradeByDepLabel"
),
map
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/facade/BookGroupFacade.java
View file @
8de659e6
...
@@ -693,4 +693,9 @@ public interface BookGroupFacade {
...
@@ -693,4 +693,9 @@ public interface BookGroupFacade {
@PostMapping
(
"listUser4ReadingActivity"
)
@PostMapping
(
"listUser4ReadingActivity"
)
public
ResponseDto
<
PageBeanNew
<
UserBookInfoVO
>>
listUser4ReadingActivity
(
public
ResponseDto
<
PageBeanNew
<
UserBookInfoVO
>>
listUser4ReadingActivity
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
@ApiParam
UserSelectParamDTO
userSelectParamDTO
)
throws
PermissionException
;
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
@ApiParam
UserSelectParamDTO
userSelectParamDTO
)
throws
PermissionException
;
@ApiOperation
(
"旧标签转换为新标签"
)
@GetMapping
(
"updateNewLabel"
)
ResponseDto
<?>
updateNewLabel
();
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/facade/impl/BookGroupFacadeImpl.java
View file @
8de659e6
...
@@ -1107,4 +1107,12 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
...
@@ -1107,4 +1107,12 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
PageBeanNew
<
UserBookInfoVO
>
pageBeanNew
=
bookGroupBiz
.
listUser4ReadingActivity
(
userSelectParamDTO
);
PageBeanNew
<
UserBookInfoVO
>
pageBeanNew
=
bookGroupBiz
.
listUser4ReadingActivity
(
userSelectParamDTO
);
return
new
ResponseDto
<>(
pageBeanNew
);
return
new
ResponseDto
<>(
pageBeanNew
);
}
}
@Override
@GetMapping
(
"updateNewLabel"
)
public
ResponseDto
<?>
updateNewLabel
(){
//社群书标签
bookGroupBiz
.
updateNewLabel
();
return
new
ResponseDto
<>();
}
}
}
pcloud-service-book/src/main/resources/mapper/book/BookLabel.Mapper.xml
View file @
8de659e6
...
@@ -35,4 +35,11 @@
...
@@ -35,4 +35,11 @@
#{item}
#{item}
</foreach>
</foreach>
</select>
</select>
<select
id=
"getByNameType"
resultType=
"long"
parameterType=
"map"
>
SELECT id FROM book_label
WHERE `name`= #{name}
AND type = #{type}
LIMIT 1
</select>
</mapper>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/group/BookGroupMapper.xml
View file @
8de659e6
...
@@ -921,4 +921,23 @@
...
@@ -921,4 +921,23 @@
and is_delete=0
and is_delete=0
limit 1
limit 1
</select>
</select>
<select
id=
"listOldLabel"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from book_group
WHERE pro_label_id>0 AND dep_label_id>0
AND is_delete=0
</select>
<update
id=
"updateSubjectByProLabel"
parameterType=
"map"
>
UPDATE book_group g INNER JOIN book_adviser a ON g.book_id=a.BOOK_ID AND g.is_delete=0 AND a.IS_DELETE=0
SET a.SUB_LABEL_ID= #{subLabelId}
WHERE g.pro_label_id= #{proLabelId}
</update>
<update
id=
"updateGradeByDepLabel"
parameterType=
"map"
>
UPDATE book_group g INNER JOIN book_adviser a ON g.book_id=a.BOOK_ID AND g.is_delete=0 AND a.IS_DELETE=0
SET a.GRA_LABEL_ID=#{graLabelId}
WHERE g.dep_label_id=#{depLabelId}
</update>
</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