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
ca7c3213
Commit
ca7c3213
authored
May 21, 2020
by
吴博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix 1002907
parent
c78253b2
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
85 additions
and
3 deletions
+85
-3
RightsSettingBizImpl.java
...oud/book/rightsSetting/biz/impl/RightsSettingBizImpl.java
+32
-2
RightsItemGroupDao.java
...com/pcloud/book/rightsSetting/dao/RightsItemGroupDao.java
+4
-0
RightsSettingItemDao.java
...m/pcloud/book/rightsSetting/dao/RightsSettingItemDao.java
+4
-0
RightsItemGroupDaoImpl.java
...d/book/rightsSetting/dao/impl/RightsItemGroupDaoImpl.java
+7
-0
RightsSettingItemDaoImpl.java
...book/rightsSetting/dao/impl/RightsSettingItemDaoImpl.java
+6
-0
RightItemGroup.xml
...rc/main/resources/mapper/rightssetting/RightItemGroup.xml
+15
-0
RightsSettingItemMapper.xml
...esources/mapper/rightssetting/RightsSettingItemMapper.xml
+16
-0
RightsSettingTitleMapper.xml
...sources/mapper/rightssetting/RightsSettingTitleMapper.xml
+1
-1
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/biz/impl/RightsSettingBizImpl.java
View file @
ca7c3213
...
...
@@ -1612,8 +1612,14 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
log
.
error
(
"该书没有匹配的分类权益,bookId="
+
bookId
);
return
new
RightsSettingDto
();
}
List
<
RightsReadType
>
rightsReadTypes
=
rightsReadTypeMapper
.
getByRightsSettingId
(
rightsSettingDto
.
getId
());
ReadTypeCountDTO
readTypeCountDTO
=
rightsSettingTitleMapper
.
getCount4Title
(
rightsSettingDto
.
getId
());
Long
rightsSettingId
=
rightsSettingDto
.
getId
();
List
<
RightsReadType
>
rightsReadTypes
=
rightsReadTypeMapper
.
getByRightsSettingId
(
rightsSettingId
);
ReadTypeCountDTO
readTypeCountDTO
=
new
ReadTypeCountDTO
();
readTypeCountDTO
.
setRightsSettingId
(
rightsSettingId
);
ReadTypeCountDTO
readTypeCountDTO4Title
=
rightsSettingTitleMapper
.
getCount4Title
(
rightsSettingId
);
ReadTypeCountDTO
readTypeCountDTO4Item
=
rightsSettingItemDao
.
getCount4Item
(
rightsSettingId
);
ReadTypeCountDTO
readTypeCountDTO4Group
=
rightsItemGroupDao
.
getCount4Group
(
rightsSettingId
);
getAllCount
(
readTypeCountDTO
,
readTypeCountDTO4Title
,
readTypeCountDTO4Item
,
readTypeCountDTO4Group
);
setReadType
(
rightsSettingDto
,
readTypeCountDTO
,
rightsReadTypes
);
rightsSettingDto
.
setChooseReadType
(
chooseReadType
);
}
...
...
@@ -1621,6 +1627,30 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
return
rightsSettingDto
;
}
private
void
getAllCount
(
ReadTypeCountDTO
readTypeCountDTO
,
ReadTypeCountDTO
readTypeCountDTO4Title
,
ReadTypeCountDTO
readTypeCountDTO4Item
,
ReadTypeCountDTO
readTypeCountDTO4Group
)
{
readTypeCountDTO
.
setEasyReadCount
(
0
);
readTypeCountDTO
.
setEfficientReadCount
(
0
);
readTypeCountDTO
.
setDeepReadCount
(
0
);
if
(
null
!=
readTypeCountDTO4Title
)
{
readTypeCountDTO
.
setEasyReadCount
(
readTypeCountDTO4Title
.
getEasyReadCount
());
readTypeCountDTO
.
setEfficientReadCount
(
readTypeCountDTO4Title
.
getEfficientReadCount
());
readTypeCountDTO
.
setDeepReadCount
(
readTypeCountDTO4Title
.
getDeepReadCount
());
}
if
(
null
!=
readTypeCountDTO4Item
)
{
readTypeCountDTO
.
setEasyReadCount
(
readTypeCountDTO
.
getEasyReadCount
()
+
readTypeCountDTO4Item
.
getEasyReadCount
());
readTypeCountDTO
.
setEfficientReadCount
(
readTypeCountDTO
.
getEfficientReadCount
()
+
readTypeCountDTO4Item
.
getEfficientReadCount
());
readTypeCountDTO
.
setDeepReadCount
(
readTypeCountDTO
.
getDeepReadCount
()
+
readTypeCountDTO4Item
.
getDeepReadCount
());
}
if
(
null
!=
readTypeCountDTO4Group
)
{
readTypeCountDTO
.
setEasyReadCount
(
readTypeCountDTO
.
getEasyReadCount
()
+
readTypeCountDTO4Group
.
getEasyReadCount
());
readTypeCountDTO
.
setEfficientReadCount
(
readTypeCountDTO
.
getEfficientReadCount
()
+
readTypeCountDTO4Group
.
getEfficientReadCount
());
readTypeCountDTO
.
setDeepReadCount
(
readTypeCountDTO
.
getDeepReadCount
()
+
readTypeCountDTO4Group
.
getDeepReadCount
());
}
}
private
void
setReadType
(
RightsSettingDto
rightsSettingDto
,
ReadTypeCountDTO
readTypeCountDTO
,
List
<
RightsReadType
>
rightsReadTypes
)
{
if
(!
ListUtils
.
isEmpty
(
rightsReadTypes
)
&&
null
!=
readTypeCountDTO
&&
(
!
Objects
.
equals
(
BookConstant
.
zero
,
readTypeCountDTO
.
getEasyReadCount
())
||
...
...
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/dao/RightsItemGroupDao.java
View file @
ca7c3213
package
com
.
pcloud
.
book
.
rightsSetting
.
dao
;
import
com.pcloud.book.rightsSetting.dto.ReadTypeCountDTO
;
import
com.pcloud.book.rightsSetting.entity.RightsItemGroup
;
import
com.pcloud.common.core.dao.BaseDao
;
...
...
@@ -19,4 +20,6 @@ public interface RightsItemGroupDao extends BaseDao<RightsItemGroup> {
void
deleteByRightsSettingId
(
Long
rightsSettingId
);
List
<
RightsItemGroup
>
getListByRightSettingId
(
Long
rightsSettingId
,
Integer
readType
);
ReadTypeCountDTO
getCount4Group
(
Long
rightsSettingId
);
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/dao/RightsSettingItemDao.java
View file @
ca7c3213
package
com
.
pcloud
.
book
.
rightsSetting
.
dao
;
import
com.pcloud.book.rightsSetting.dto.ReadTypeCountDTO
;
import
com.pcloud.book.rightsSetting.entity.RightsSettingClassify
;
import
com.pcloud.book.rightsSetting.entity.RightsSettingItem
;
import
com.pcloud.common.core.dao.BaseDao
;
...
...
@@ -42,4 +43,6 @@ public interface RightsSettingItemDao extends BaseDao<RightsSettingItem>{
List
<
RightsSettingItem
>
getItemByRightsIdAndType
(
Long
rightsSettingId
,
String
rightsType
);
List
<
RightsSettingItem
>
getItemsByRightsSettingId4Read
(
Long
rightsSettingId
,
String
rightsType
);
ReadTypeCountDTO
getCount4Item
(
Long
rightsSettingId
);
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/dao/impl/RightsItemGroupDaoImpl.java
View file @
ca7c3213
package
com
.
pcloud
.
book
.
rightsSetting
.
dao
.
impl
;
import
com.pcloud.book.rightsSetting.dao.RightsItemGroupDao
;
import
com.pcloud.book.rightsSetting.dto.ReadTypeCountDTO
;
import
com.pcloud.book.rightsSetting.entity.RightsItemGroup
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Component
;
...
...
@@ -36,4 +37,9 @@ public class RightsItemGroupDaoImpl extends BaseDaoImpl<RightsItemGroup> impleme
map
.
put
(
"readType"
,
readType
);
return
super
.
getSqlSession
().
selectList
(
getStatement
(
"getListByRightSettingId"
),
map
);
}
@Override
public
ReadTypeCountDTO
getCount4Group
(
Long
rightsSettingId
)
{
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getCount4Group"
),
rightsSettingId
);
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/dao/impl/RightsSettingItemDaoImpl.java
View file @
ca7c3213
package
com
.
pcloud
.
book
.
rightsSetting
.
dao
.
impl
;
import
com.pcloud.book.rightsSetting.dao.RightsSettingItemDao
;
import
com.pcloud.book.rightsSetting.dto.ReadTypeCountDTO
;
import
com.pcloud.book.rightsSetting.entity.RightsSettingClassify
;
import
com.pcloud.book.rightsSetting.entity.RightsSettingItem
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
...
...
@@ -54,4 +55,9 @@ public class RightsSettingItemDaoImpl extends BaseDaoImpl<RightsSettingItem> imp
map
.
put
(
"rightsType"
,
rightsType
);
return
getSessionTemplate
().
selectList
(
getStatement
(
"getItemsByRightsSettingId4Read"
),
map
);
}
@Override
public
ReadTypeCountDTO
getCount4Item
(
Long
rightsSettingId
)
{
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getCount4Item"
),
rightsSettingId
);
}
}
pcloud-service-book/src/main/resources/mapper/rightssetting/RightItemGroup.xml
View file @
ca7c3213
...
...
@@ -97,4 +97,18 @@
</choose>
</select>
<select
id=
"getCount4Group"
parameterType=
"long"
resultType=
"com.pcloud.book.rightsSetting.dto.ReadTypeCountDTO"
>
SELECT
rights_setting_id rightsSettingId,
SUM(IFNULL(easy_read, 0)) easyReadCount,
SUM(IFNULL(efficient_read, 0)) efficientReadCount,
SUM(IFNULL(deep_read, 0)) deepReadCount
FROM
rights_item_group
GROUP BY
rights_setting_id
HAVING
rights_setting_id = #{rightsSettingId};
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/rightssetting/RightsSettingItemMapper.xml
View file @
ca7c3213
...
...
@@ -124,4 +124,19 @@
order by i.id asc
</select>
<select
id=
"getCount4Item"
parameterType=
"long"
resultType=
"com.pcloud.book.rightsSetting.dto.ReadTypeCountDTO"
>
SELECT
rights_setting_id rightsSettingId,
SUM(IFNULL(easy_read, 0)) easyReadCount,
SUM(IFNULL(efficient_read, 0)) efficientReadCount,
SUM(IFNULL(deep_read, 0)) deepReadCount
FROM
rights_setting_item
GROUP BY
rights_setting_id
HAVING
rights_setting_id = #{rightsSettingId};
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/rightssetting/RightsSettingTitleMapper.xml
View file @
ca7c3213
...
...
@@ -201,7 +201,7 @@
SUM(IFNULL(efficient_read, 0)) efficientReadCount,
SUM(IFNULL(deep_read, 0)) deepReadCount
FROM
`rights_setting_title`
rights_setting_title
GROUP BY
rights_setting_id
HAVING
...
...
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