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
f457f41b
Commit
f457f41b
authored
Aug 04, 2020
by
朱亚洁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:[1003353]小睿书刊分类添加版本标签
parent
6fdaf590
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
87 additions
and
25 deletions
+87
-25
AppletUserBookcaseBizImpl.java
...cloud/book/applet/biz/impl/AppletUserBookcaseBizImpl.java
+16
-2
BookAdviserBizImpl.java
...ava/com/pcloud/book/book/biz/impl/BookAdviserBizImpl.java
+1
-1
RightsSettingBiz.java
...a/com/pcloud/book/rightsSetting/biz/RightsSettingBiz.java
+1
-1
RightsSettingBizImpl.java
...oud/book/rightsSetting/biz/impl/RightsSettingBizImpl.java
+32
-11
RightsSettingConstant.java
...d/book/rightsSetting/constants/RightsSettingConstant.java
+4
-0
RightsSettingDAO.java
...a/com/pcloud/book/rightsSetting/dao/RightsSettingDAO.java
+1
-1
RightsSettingDAOImpl.java
...oud/book/rightsSetting/dao/impl/RightsSettingDAOImpl.java
+2
-1
RightsSettingDto.java
...a/com/pcloud/book/rightsSetting/dto/RightsSettingDto.java
+2
-0
BaseTempletClassify.java
...pcloud/book/rightsSetting/entity/BaseTempletClassify.java
+2
-0
RightsSetting.java
...a/com/pcloud/book/rightsSetting/entity/RightsSetting.java
+3
-0
RightsSettingFacede.java
...pcloud/book/rightsSetting/facade/RightsSettingFacede.java
+3
-1
RightsSettingMapper.xml
...in/resources/mapper/rightssetting/RightsSettingMapper.xml
+20
-7
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/applet/biz/impl/AppletUserBookcaseBizImpl.java
View file @
f457f41b
...
@@ -40,12 +40,12 @@ import com.pcloud.common.utils.ListUtils;
...
@@ -40,12 +40,12 @@ import com.pcloud.common.utils.ListUtils;
import
com.pcloud.common.utils.cache.redis.JedisClusterUtils
;
import
com.pcloud.common.utils.cache.redis.JedisClusterUtils
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.common.utils.string.StringUtil
;
import
java.util.Arrays
;
import
org.apache.commons.collections.MapUtils
;
import
org.apache.commons.collections.MapUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
...
@@ -108,6 +108,7 @@ public class AppletUserBookcaseBizImpl implements AppletUserBookcaseBiz {
...
@@ -108,6 +108,7 @@ public class AppletUserBookcaseBizImpl implements AppletUserBookcaseBiz {
@Override
@Override
public
PageBeanNew
<
AppletUserBookcaseDTO
>
listByWechatUserId
(
Long
wechatUserId
,
Integer
currentPage
,
Integer
numPerPage
)
{
public
PageBeanNew
<
AppletUserBookcaseDTO
>
listByWechatUserId
(
Long
wechatUserId
,
Integer
currentPage
,
Integer
numPerPage
)
{
//缓存中查
String
key
=
AppletConstants
.
USER_BOOK_CASE
+
wechatUserId
;
String
key
=
AppletConstants
.
USER_BOOK_CASE
+
wechatUserId
;
String
field
=
currentPage
+
"-"
+
numPerPage
;
String
field
=
currentPage
+
"-"
+
numPerPage
;
String
countKey
=
AppletConstants
.
USER_BOOK_CASE_COUNT
+
wechatUserId
;
String
countKey
=
AppletConstants
.
USER_BOOK_CASE_COUNT
+
wechatUserId
;
...
@@ -117,9 +118,22 @@ public class AppletUserBookcaseBizImpl implements AppletUserBookcaseBiz {
...
@@ -117,9 +118,22 @@ public class AppletUserBookcaseBizImpl implements AppletUserBookcaseBiz {
if
(!
StringUtil
.
isEmpty
(
countStr
))
{
if
(!
StringUtil
.
isEmpty
(
countStr
))
{
count
=
Integer
.
valueOf
(
countStr
);
count
=
Integer
.
valueOf
(
countStr
);
}
}
if
(!
ListUtils
.
isEmpty
(
bookcaseDTOS
)
&&
count
>
0
)
{
//首页数据是否正确
Boolean
correct
=
true
;
if
(
0
==
currentPage
&&
1
==
numPerPage
&&
!
ListUtils
.
isEmpty
(
bookcaseDTOS
))
{
AppletUserBookcaseDTO
appletUserBookcase
=
bookcaseDTOS
.
get
(
0
);
Long
settingId
=
appletUserBookcase
.
getRightsSettingId
()
==
null
?
0L
:
appletUserBookcase
.
getRightsSettingId
();
RightsSettingDto
rightsSettingDto
=
rightsSettingBiz
.
getRightsSettingByBookId4AppletHome
(
appletUserBookcase
.
getBookId
(),
appletUserBookcase
.
getAdviserId
(),
appletUserBookcase
.
getChannelId
());
Long
actualSettingId
=
rightsSettingDto
.
getId
()
==
null
?
0L
:
rightsSettingDto
.
getId
();
if
(!
actualSettingId
.
equals
(
settingId
))
{
correct
=
false
;
appletUserBookcaseDao
.
updateRightsSettingId
(
actualSettingId
>
0
?
actualSettingId
:
null
,
appletUserBookcase
.
getBookId
(),
appletUserBookcase
.
getAdviserId
(),
appletUserBookcase
.
getChannelId
());
}
}
if
(!
ListUtils
.
isEmpty
(
bookcaseDTOS
)
&&
count
>
0
&&
correct
)
{
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
count
,
bookcaseDTOS
);
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
count
,
bookcaseDTOS
);
}
}
//数据库查询
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"wechatUserId"
,
wechatUserId
);
map
.
put
(
"wechatUserId"
,
wechatUserId
);
PageBeanNew
<
AppletUserBookcaseDTO
>
pageBeanNew
=
appletUserBookcaseDao
.
listPageNew
(
PageBeanNew
<
AppletUserBookcaseDTO
>
pageBeanNew
=
appletUserBookcaseDao
.
listPageNew
(
...
...
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookAdviserBizImpl.java
View file @
f457f41b
...
@@ -897,7 +897,7 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -897,7 +897,7 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
BookAdviserDto
adviserDto
=
bookAdviserDao
.
getBase
(
bookId
,
channelId
,
adviserId
);
BookAdviserDto
adviserDto
=
bookAdviserDao
.
getBase
(
bookId
,
channelId
,
adviserId
);
if
(
null
!=
adviserDto
){
if
(
null
!=
adviserDto
){
RightsSettingDto
rightsSettingDto
=
rightsSettingBiz
.
getByLabel
(
adviserDto
.
getTempletId
(),
RightsSettingDto
rightsSettingDto
=
rightsSettingBiz
.
getByLabel
(
adviserDto
.
getTempletId
(),
adviserDto
.
getSecondTempletId
(),
adviserDto
.
getGraLabelId
(),
adviserDto
.
getSubLabelId
(),
adviserDto
.
getVolLabelId
());
adviserDto
.
getSecondTempletId
(),
adviserDto
.
getGraLabelId
(),
adviserDto
.
getSubLabelId
(),
adviserDto
.
getVolLabelId
()
,
adviserDto
.
getVerLabelId
()
);
if
(
null
!=
rightsSettingDto
){
if
(
null
!=
rightsSettingDto
){
bookRightsSettingDTO
.
setRightsSettingDetail
(
rightsSettingDto
.
getDetail
());
bookRightsSettingDTO
.
setRightsSettingDetail
(
rightsSettingDto
.
getDetail
());
bookRightsSettingDTO
.
setRightsSettingIntroduce
(
rightsSettingDto
.
getIntroduce
());
bookRightsSettingDTO
.
setRightsSettingIntroduce
(
rightsSettingDto
.
getIntroduce
());
...
...
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/biz/RightsSettingBiz.java
View file @
f457f41b
...
@@ -27,7 +27,7 @@ public interface RightsSettingBiz {
...
@@ -27,7 +27,7 @@ public interface RightsSettingBiz {
PageBeanNew
<
RightsSettingDto
>
listRightsSettingPage
(
Integer
currentPage
,
Integer
numPerPage
,
RightsSetting
rightsSetting
);
PageBeanNew
<
RightsSettingDto
>
listRightsSettingPage
(
Integer
currentPage
,
Integer
numPerPage
,
RightsSetting
rightsSetting
);
RightsSettingDto
getByLabel
(
Long
firstClassify
,
Long
secondClassify
,
Long
gradeLabelId
,
Long
subjectLabelId
,
Long
volLabelId
);
RightsSettingDto
getByLabel
(
Long
firstClassify
,
Long
secondClassify
,
Long
gradeLabelId
,
Long
subjectLabelId
,
Long
volLabelId
,
Long
verLabelId
);
Integer
getUserCount
();
Integer
getUserCount
();
...
...
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/biz/impl/RightsSettingBizImpl.java
View file @
f457f41b
package
com
.
pcloud
.
book
.
rightsSetting
.
biz
.
impl
;
package
com
.
pcloud
.
book
.
rightsSetting
.
biz
.
impl
;
import
cn.hutool.core.collection.CollUtil
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.pcloud.appcenter.app.dto.AppDto
;
import
com.pcloud.appcenter.app.dto.AppDto
;
import
com.pcloud.appcenter.assist.dto.AssistTempletDTO
;
import
com.pcloud.appcenter.assist.dto.AssistTempletDTO
;
import
com.pcloud.book.applet.biz.AppletGroupSearchRecordBiz
;
import
com.pcloud.book.applet.biz.AppletGroupSearchRecordBiz
;
...
@@ -14,7 +14,6 @@ import com.pcloud.book.applet.dto.AppletGroupStatementDTO;
...
@@ -14,7 +14,6 @@ import com.pcloud.book.applet.dto.AppletGroupStatementDTO;
import
com.pcloud.book.applet.dto.AppletNewsDTO
;
import
com.pcloud.book.applet.dto.AppletNewsDTO
;
import
com.pcloud.book.applet.dto.AppletNewsServeDTO
;
import
com.pcloud.book.applet.dto.AppletNewsServeDTO
;
import
com.pcloud.book.applet.entity.AppletNews
;
import
com.pcloud.book.applet.entity.AppletNews
;
import
com.pcloud.book.applet.entity.AppletNewsServe
;
import
com.pcloud.book.applet.entity.AppletUserBookcase
;
import
com.pcloud.book.applet.entity.AppletUserBookcase
;
import
com.pcloud.book.applet.enums.AppletNewsServeTypeEnum
;
import
com.pcloud.book.applet.enums.AppletNewsServeTypeEnum
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.base.exception.BookBizException
;
...
@@ -95,9 +94,7 @@ import com.pcloud.common.utils.cache.redis.JedisClusterUtils;
...
@@ -95,9 +94,7 @@ import com.pcloud.common.utils.cache.redis.JedisClusterUtils;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.common.utils.string.StringUtilParent
;
import
com.pcloud.common.utils.string.StringUtilParent
;
import
com.pcloud.resourcecenter.product.dto.ProductDto
;
import
com.pcloud.resourcecenter.product.dto.ProductDto
;
import
java.util.Arrays
;
import
java.util.Comparator
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.MapUtils
;
import
org.apache.commons.collections.MapUtils
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.apache.commons.lang3.ArrayUtils
;
...
@@ -107,6 +104,7 @@ import org.springframework.stereotype.Service;
...
@@ -107,6 +104,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -120,6 +118,9 @@ import java.util.concurrent.atomic.AtomicInteger;
...
@@ -120,6 +118,9 @@ import java.util.concurrent.atomic.AtomicInteger;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
cn.hutool.core.collection.CollUtil
;
import
lombok.extern.slf4j.Slf4j
;
@Service
@Service
@Slf4j
@Slf4j
public
class
RightsSettingBizImpl
implements
RightsSettingBiz
{
public
class
RightsSettingBizImpl
implements
RightsSettingBiz
{
...
@@ -267,6 +268,9 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
...
@@ -267,6 +268,9 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
if
(!
ArrayUtils
.
contains
(
RightsSettingConstant
.
K12_VOLUME_ID
,
baseTempletClassify
.
getFirstClassify
()))
{
if
(!
ArrayUtils
.
contains
(
RightsSettingConstant
.
K12_VOLUME_ID
,
baseTempletClassify
.
getFirstClassify
()))
{
baseTempletClassify
.
setVolLabelId
(
null
);
baseTempletClassify
.
setVolLabelId
(
null
);
}
}
if
(!
ArrayUtils
.
contains
(
RightsSettingConstant
.
K12_VERSION_ID
,
baseTempletClassify
.
getFirstClassify
()))
{
baseTempletClassify
.
setVerLabelId
(
null
);
}
}
}
/**
/**
...
@@ -294,6 +298,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
...
@@ -294,6 +298,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
paramMap
.
put
(
"gradeLabelId"
,
rightsSetting
.
getGradeLabelId
());
paramMap
.
put
(
"gradeLabelId"
,
rightsSetting
.
getGradeLabelId
());
paramMap
.
put
(
"subjectLabelId"
,
rightsSetting
.
getSubjectLabelId
());
paramMap
.
put
(
"subjectLabelId"
,
rightsSetting
.
getSubjectLabelId
());
paramMap
.
put
(
"volLabelId"
,
rightsSetting
.
getVolLabelId
());
paramMap
.
put
(
"volLabelId"
,
rightsSetting
.
getVolLabelId
());
paramMap
.
put
(
"verLabelId"
,
rightsSetting
.
getVerLabelId
());
}
}
List
<
RightsSettingDto
>
list
=
rightsSettingDAO
.
listRightsSettingPage
(
paramMap
);
List
<
RightsSettingDto
>
list
=
rightsSettingDAO
.
listRightsSettingPage
(
paramMap
);
count
=
list
.
size
();
count
=
list
.
size
();
...
@@ -1456,6 +1461,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
...
@@ -1456,6 +1461,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
paramMap
.
put
(
"gradeLabelId"
,
rightsSetting
.
getGradeLabelId
());
paramMap
.
put
(
"gradeLabelId"
,
rightsSetting
.
getGradeLabelId
());
paramMap
.
put
(
"subjectLabelId"
,
rightsSetting
.
getSubjectLabelId
());
paramMap
.
put
(
"subjectLabelId"
,
rightsSetting
.
getSubjectLabelId
());
paramMap
.
put
(
"volLabelId"
,
rightsSetting
.
getVolLabelId
());
paramMap
.
put
(
"volLabelId"
,
rightsSetting
.
getVolLabelId
());
paramMap
.
put
(
"verLabelId"
,
rightsSetting
.
getVerLabelId
());
rightsSettingDtoPageBeanNew
=
rightsSettingDAO
rightsSettingDtoPageBeanNew
=
rightsSettingDAO
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
paramMap
,
"listRightsSettingPage"
);
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
paramMap
,
"listRightsSettingPage"
);
}
}
...
@@ -1521,6 +1527,9 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
...
@@ -1521,6 +1527,9 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
if
(
null
!=
rightsSettingDto
.
getVolLabelId
())
{
if
(
null
!=
rightsSettingDto
.
getVolLabelId
())
{
labelIds
.
add
(
rightsSettingDto
.
getVolLabelId
());
labelIds
.
add
(
rightsSettingDto
.
getVolLabelId
());
}
}
if
(
null
!=
rightsSettingDto
.
getVerLabelId
()){
labelIds
.
add
(
rightsSettingDto
.
getVerLabelId
());
}
}
}
Map
<
Long
,
AssistTempletDTO
>
classifyMap
=
new
HashMap
<>();
Map
<
Long
,
AssistTempletDTO
>
classifyMap
=
new
HashMap
<>();
Map
<
Long
,
BookLabel
>
labelMap
=
new
HashMap
<>();
Map
<
Long
,
BookLabel
>
labelMap
=
new
HashMap
<>();
...
@@ -1546,11 +1555,15 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
...
@@ -1546,11 +1555,15 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
if
(!
MapUtils
.
isEmpty
(
labelMap
)
&&
labelMap
.
containsKey
(
rightsSettingDto
.
getVolLabelId
()))
{
if
(!
MapUtils
.
isEmpty
(
labelMap
)
&&
labelMap
.
containsKey
(
rightsSettingDto
.
getVolLabelId
()))
{
rightsSettingDto
.
setVolLabelContent
(
labelMap
.
get
(
rightsSettingDto
.
getVolLabelId
()).
getName
());
rightsSettingDto
.
setVolLabelContent
(
labelMap
.
get
(
rightsSettingDto
.
getVolLabelId
()).
getName
());
}
}
if
(!
MapUtils
.
isEmpty
(
labelMap
)
&&
labelMap
.
containsKey
(
rightsSettingDto
.
getVerLabelId
())){
rightsSettingDto
.
setVerLabelContent
(
labelMap
.
get
(
rightsSettingDto
.
getVerLabelId
()).
getName
());
}
}
}
}
}
@Override
@Override
public
RightsSettingDto
getByLabel
(
Long
firstClassify
,
Long
secondClassify
,
Long
gradeLabelId
,
Long
subjectLabelId
,
Long
volLabelId
)
{
public
RightsSettingDto
getByLabel
(
Long
firstClassify
,
Long
secondClassify
,
Long
gradeLabelId
,
Long
subjectLabelId
,
Long
volLabelId
,
Long
verLabelId
)
{
//医疗保健分类校验
//医疗保健分类校验
if
(
ArrayUtils
.
contains
(
RightsSettingConstant
.
MEDICAL_INSURANCE_TEMPLET_ID
,
firstClassify
))
{
if
(
ArrayUtils
.
contains
(
RightsSettingConstant
.
MEDICAL_INSURANCE_TEMPLET_ID
,
firstClassify
))
{
subjectLabelId
=
null
;
subjectLabelId
=
null
;
...
@@ -1570,7 +1583,16 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
...
@@ -1570,7 +1583,16 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
if
(!
ArrayUtils
.
contains
(
RightsSettingConstant
.
K12_VOLUME_ID
,
firstClassify
))
{
if
(!
ArrayUtils
.
contains
(
RightsSettingConstant
.
K12_VOLUME_ID
,
firstClassify
))
{
volLabelId
=
null
;
volLabelId
=
null
;
}
}
RightsSettingDto
dto
=
rightsSettingDAO
.
getByLabel
(
firstClassify
,
secondClassify
,
gradeLabelId
,
subjectLabelId
,
volLabelId
);
//版本标签校验
if
(!
ArrayUtils
.
contains
(
RightsSettingConstant
.
K12_VERSION_ID
,
firstClassify
)){
verLabelId
=
null
;
}
RightsSettingDto
dto
=
rightsSettingDAO
.
getByLabel
(
firstClassify
,
secondClassify
,
gradeLabelId
,
subjectLabelId
,
volLabelId
,
verLabelId
);
//有版本筛选但权益未配置
if
(
null
==
dto
&&
verLabelId
>
0
)
{
Long
commonLabelId
=
bookLabelDao
.
getByNameType
(
"通用版"
,
3
);
dto
=
rightsSettingDAO
.
getByLabel
(
firstClassify
,
secondClassify
,
gradeLabelId
,
subjectLabelId
,
volLabelId
,
commonLabelId
);
}
return
dto
;
return
dto
;
}
}
...
@@ -1628,14 +1650,13 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
...
@@ -1628,14 +1650,13 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
if
(
null
!=
rightsSettingDto
)
{
if
(
null
!=
rightsSettingDto
)
{
rightsSettingDto
rightsSettingDto
.
setRightsSettingBookRelations
(
rightsSettingBookRelationMapper
.
selectByRithsSettingId
(
rightsSettingDto
.
getId
()));
.
setRightsSettingBookRelations
(
rightsSettingBookRelationMapper
.
selectByRithsSettingId
(
rightsSettingDto
.
getId
()));
;
}
}
if
(
null
==
rightsSettingDto
)
{
if
(
null
==
rightsSettingDto
)
{
//根据分类获取权益
//根据分类获取权益
BookAdviserDto
adviserDto
=
bookAdviserBiz
.
getBase
(
bookId
,
channelId
,
adviserId
);
BookAdviserDto
adviserDto
=
bookAdviserBiz
.
getBase
(
bookId
,
channelId
,
adviserId
);
if
(
null
!=
adviserDto
)
{
if
(
null
!=
adviserDto
)
{
rightsSettingDto
=
getByLabel
(
adviserDto
.
getTempletId
(),
adviserDto
.
getSecondTempletId
(),
adviserDto
.
getGraLabelId
(),
rightsSettingDto
=
getByLabel
(
adviserDto
.
getTempletId
(),
adviserDto
.
getSecondTempletId
(),
adviserDto
.
getGraLabelId
(),
adviserDto
.
getSubLabelId
(),
adviserDto
.
getVolLabelId
());
adviserDto
.
getSubLabelId
(),
adviserDto
.
getVolLabelId
()
,
adviserDto
.
getVerLabelId
()
);
}
}
}
}
if
(
null
==
rightsSettingDto
)
{
if
(
null
==
rightsSettingDto
)
{
...
@@ -2311,7 +2332,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
...
@@ -2311,7 +2332,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
BookAdviserDto
adviserDto
=
bookAdviserBiz
.
getBase
(
bookId
,
channelId
,
adviserId
);
BookAdviserDto
adviserDto
=
bookAdviserBiz
.
getBase
(
bookId
,
channelId
,
adviserId
);
if
(
null
!=
adviserDto
)
{
if
(
null
!=
adviserDto
)
{
rightsSettingDto
=
getByLabel
(
adviserDto
.
getTempletId
(),
adviserDto
.
getSecondTempletId
(),
adviserDto
.
getGraLabelId
(),
rightsSettingDto
=
getByLabel
(
adviserDto
.
getTempletId
(),
adviserDto
.
getSecondTempletId
(),
adviserDto
.
getGraLabelId
(),
adviserDto
.
getSubLabelId
(),
adviserDto
.
getVolLabelId
());
adviserDto
.
getSubLabelId
(),
adviserDto
.
getVolLabelId
()
,
adviserDto
.
getVerLabelId
()
);
if
(
null
==
rightsSettingDto
)
{
if
(
null
==
rightsSettingDto
)
{
log
.
error
(
"该书没有匹配的分类权益,bookId="
+
bookId
);
log
.
error
(
"该书没有匹配的分类权益,bookId="
+
bookId
);
return
new
RightsSettingDto
();
return
new
RightsSettingDto
();
...
@@ -2454,7 +2475,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
...
@@ -2454,7 +2475,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
//根据分类获取权益
//根据分类获取权益
BookAdviserDto
adviserDto
=
bookAdviserBiz
.
getBase
(
bookId
,
channelId
,
adviserId
);
BookAdviserDto
adviserDto
=
bookAdviserBiz
.
getBase
(
bookId
,
channelId
,
adviserId
);
return
getByLabel
(
adviserDto
.
getTempletId
(),
adviserDto
.
getSecondTempletId
(),
adviserDto
.
getGraLabelId
(),
return
getByLabel
(
adviserDto
.
getTempletId
(),
adviserDto
.
getSecondTempletId
(),
adviserDto
.
getGraLabelId
(),
adviserDto
.
getSubLabelId
(),
adviserDto
.
getVolLabelId
());
adviserDto
.
getSubLabelId
(),
adviserDto
.
getVolLabelId
()
,
adviserDto
.
getVerLabelId
()
);
}
}
@Override
@Override
...
...
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/constants/RightsSettingConstant.java
View file @
f457f41b
...
@@ -18,6 +18,10 @@ public class RightsSettingConstant {
...
@@ -18,6 +18,10 @@ public class RightsSettingConstant {
*/
*/
public
static
final
Long
[]
K12_VOLUME_ID
=
{
48L
,
59L
,
46L
,
40L
,
65L
};
public
static
final
Long
[]
K12_VOLUME_ID
=
{
48L
,
59L
,
46L
,
40L
,
65L
};
/**
/**
* 所属k12教育/学前教育的书刊分类id---有版本分类
*/
public
static
final
Long
[]
K12_VERSION_ID
=
{
48L
,
59L
,
46L
,
40L
,
65L
,
73L
};
/**
* 医疗保健编辑书刊分类id
* 医疗保健编辑书刊分类id
*/
*/
public
static
final
Long
[]
MEDICAL_INSURANCE_TEMPLET_ID
=
{
63L
};
public
static
final
Long
[]
MEDICAL_INSURANCE_TEMPLET_ID
=
{
63L
};
...
...
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/dao/RightsSettingDAO.java
View file @
f457f41b
...
@@ -16,7 +16,7 @@ public interface RightsSettingDAO extends BaseDao<RightsSetting> {
...
@@ -16,7 +16,7 @@ public interface RightsSettingDAO extends BaseDao<RightsSetting> {
int
updateByPrimaryKey
(
RightsSetting
record
);
int
updateByPrimaryKey
(
RightsSetting
record
);
RightsSettingDto
getByLabel
(
Long
firstClassify
,
Long
secondClassify
,
Long
gradeLabelId
,
Long
subjectLabelId
,
Long
volLabelId
);
RightsSettingDto
getByLabel
(
Long
firstClassify
,
Long
secondClassify
,
Long
gradeLabelId
,
Long
subjectLabelId
,
Long
volLabelId
,
Long
verLabelId
);
RightsSettingDto
getByBookId
(
Long
bookId
);
RightsSettingDto
getByBookId
(
Long
bookId
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/dao/impl/RightsSettingDAOImpl.java
View file @
f457f41b
...
@@ -33,13 +33,14 @@ public class RightsSettingDAOImpl extends BaseDaoImpl<RightsSetting> implement
...
@@ -33,13 +33,14 @@ public class RightsSettingDAOImpl extends BaseDaoImpl<RightsSetting> implement
}
}
@Override
@Override
public
RightsSettingDto
getByLabel
(
Long
firstClassify
,
Long
secondClassify
,
Long
gradeLabelId
,
Long
subjectLabelId
,
Long
volLabelId
)
{
public
RightsSettingDto
getByLabel
(
Long
firstClassify
,
Long
secondClassify
,
Long
gradeLabelId
,
Long
subjectLabelId
,
Long
volLabelId
,
Long
verLabelId
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"firstClassify"
,
firstClassify
);
paramMap
.
put
(
"firstClassify"
,
firstClassify
);
paramMap
.
put
(
"secondClassify"
,
secondClassify
);
paramMap
.
put
(
"secondClassify"
,
secondClassify
);
paramMap
.
put
(
"gradeLabelId"
,
gradeLabelId
);
paramMap
.
put
(
"gradeLabelId"
,
gradeLabelId
);
paramMap
.
put
(
"subjectLabelId"
,
subjectLabelId
);
paramMap
.
put
(
"subjectLabelId"
,
subjectLabelId
);
paramMap
.
put
(
"volLabelId"
,
volLabelId
);
paramMap
.
put
(
"volLabelId"
,
volLabelId
);
paramMap
.
put
(
"verLabelId"
,
verLabelId
);
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getByLabel"
),
paramMap
);
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getByLabel"
),
paramMap
);
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/dto/RightsSettingDto.java
View file @
f457f41b
...
@@ -28,4 +28,6 @@ public class RightsSettingDto extends RightsSetting {
...
@@ -28,4 +28,6 @@ public class RightsSettingDto extends RightsSetting {
private
Integer
chooseReadType
;
private
Integer
chooseReadType
;
private
String
volLabelContent
;
private
String
volLabelContent
;
private
String
verLabelContent
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/entity/BaseTempletClassify.java
View file @
f457f41b
...
@@ -21,4 +21,6 @@ public class BaseTempletClassify extends BaseEntity {
...
@@ -21,4 +21,6 @@ public class BaseTempletClassify extends BaseEntity {
private
Long
subjectLabelId
;
private
Long
subjectLabelId
;
@ApiModelProperty
(
"上下册标签id"
)
@ApiModelProperty
(
"上下册标签id"
)
private
Long
volLabelId
;
private
Long
volLabelId
;
@ApiModelProperty
(
"版本标签"
)
private
Long
verLabelId
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/entity/RightsSetting.java
View file @
f457f41b
...
@@ -141,6 +141,9 @@ public class RightsSetting extends BaseTempletClassify {
...
@@ -141,6 +141,9 @@ public class RightsSetting extends BaseTempletClassify {
@ApiModelProperty
(
"小程序对象"
)
@ApiModelProperty
(
"小程序对象"
)
private
AppletNewsServeDTO
guideAppletServe
;
private
AppletNewsServeDTO
guideAppletServe
;
@ApiModelProperty
(
"版本标签"
)
private
Long
verLabelId
;
public
RightsSetting
()
{
public
RightsSetting
()
{
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/facade/RightsSettingFacede.java
View file @
f457f41b
...
@@ -80,7 +80,8 @@ public class RightsSettingFacede {
...
@@ -80,7 +80,8 @@ public class RightsSettingFacede {
@RequestParam
(
value
=
"gradeLabelId"
,
required
=
false
)
Long
gradeLabelId
,
@RequestParam
(
value
=
"gradeLabelId"
,
required
=
false
)
Long
gradeLabelId
,
@RequestParam
(
value
=
"subjectLabelId"
,
required
=
false
)
Long
subjectLabelId
,
@RequestParam
(
value
=
"rightsSettingType"
,
required
=
false
,
defaultValue
=
"1"
)
Integer
rightsSettingType
,
@RequestParam
(
value
=
"subjectLabelId"
,
required
=
false
)
Long
subjectLabelId
,
@RequestParam
(
value
=
"rightsSettingType"
,
required
=
false
,
defaultValue
=
"1"
)
Integer
rightsSettingType
,
@RequestParam
(
value
=
"bookQuery"
,
required
=
false
)
String
bookQuery
,
@RequestParam
(
value
=
"bookQuery"
,
required
=
false
)
String
bookQuery
,
@RequestParam
(
value
=
"volLabelId"
,
required
=
false
)
Long
volLabelId
@RequestParam
(
value
=
"volLabelId"
,
required
=
false
)
Long
volLabelId
,
@RequestParam
(
value
=
"verLabelId"
,
required
=
false
)
Long
verLabelId
)
throws
PermissionException
{
)
throws
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
SessionUtil
.
getToken4Redis
(
token
);
...
@@ -92,6 +93,7 @@ public class RightsSettingFacede {
...
@@ -92,6 +93,7 @@ public class RightsSettingFacede {
rightsSetting
.
setRightsSettingType
(
rightsSettingType
);
rightsSetting
.
setRightsSettingType
(
rightsSettingType
);
rightsSetting
.
setBookQuery
(
bookQuery
);
rightsSetting
.
setBookQuery
(
bookQuery
);
rightsSetting
.
setVolLabelId
(
volLabelId
);
rightsSetting
.
setVolLabelId
(
volLabelId
);
rightsSetting
.
setVerLabelId
(
verLabelId
);
return
new
ResponseDto
<
PageBeanNew
<
RightsSettingDto
>>(
rightsSettingBiz
.
listRightsSettingPage
(
currentPage
,
numPerPage
,
rightsSetting
));
return
new
ResponseDto
<
PageBeanNew
<
RightsSettingDto
>>(
rightsSettingBiz
.
listRightsSettingPage
(
currentPage
,
numPerPage
,
rightsSetting
));
}
}
...
...
pcloud-service-book/src/main/resources/mapper/rightssetting/RightsSettingMapper.xml
View file @
f457f41b
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
<result
column=
"guide_type"
property=
"guideType"
jdbcType=
"VARCHAR"
/>
<result
column=
"guide_type"
property=
"guideType"
jdbcType=
"VARCHAR"
/>
<result
column=
"guide_id"
property=
"guideId"
jdbcType=
"BIGINT"
/>
<result
column=
"guide_id"
property=
"guideId"
jdbcType=
"BIGINT"
/>
<result
column=
"guide_pic"
property=
"guidePic"
jdbcType=
"VARCHAR"
/>
<result
column=
"guide_pic"
property=
"guidePic"
jdbcType=
"VARCHAR"
/>
<result
column=
"ver_label_id"
property=
"verLabelId"
jdbcType=
"BIGINT"
/>
</resultMap>
</resultMap>
<resultMap
id=
"DtoResultMap"
type=
"com.pcloud.book.rightsSetting.dto.RightsSettingDto"
>
<resultMap
id=
"DtoResultMap"
type=
"com.pcloud.book.rightsSetting.dto.RightsSettingDto"
>
...
@@ -47,6 +48,7 @@
...
@@ -47,6 +48,7 @@
<result
column=
"draw_open"
property=
"drawNowOpen"
jdbcType=
"BOOLEAN"
/>
<result
column=
"draw_open"
property=
"drawNowOpen"
jdbcType=
"BOOLEAN"
/>
<result
column=
"read_type_title"
property=
"readTypeTitle"
jdbcType=
"VARCHAR"
/>
<result
column=
"read_type_title"
property=
"readTypeTitle"
jdbcType=
"VARCHAR"
/>
<result
column=
"vol_label_id"
property=
"volLabelId"
jdbcType=
"BIGINT"
/>
<result
column=
"vol_label_id"
property=
"volLabelId"
jdbcType=
"BIGINT"
/>
<result
column=
"ver_label_id"
property=
"verLabelId"
jdbcType=
"BIGINT"
/>
</resultMap>
</resultMap>
<resultMap
id=
"DtoResultMap4Book"
type=
"com.pcloud.book.rightsSetting.dto.RightsSettingDto"
extends=
"DtoResultMap"
>
<resultMap
id=
"DtoResultMap4Book"
type=
"com.pcloud.book.rightsSetting.dto.RightsSettingDto"
extends=
"DtoResultMap"
>
...
@@ -58,13 +60,13 @@
...
@@ -58,13 +60,13 @@
id, introduce, detail, count, first_classify, second_classify, grade_label_id, subject_label_id,
id, introduce, detail, count, first_classify, second_classify, grade_label_id, subject_label_id,
create_time, update_time, enable_group_service, rights_setting_type, book_id
create_time, update_time, enable_group_service, rights_setting_type, book_id
,online_course_open,learning_tool_open,draw_open,read_type_title, vol_label_id,
,online_course_open,learning_tool_open,draw_open,read_type_title, vol_label_id,
reading_guide,guide_title,guide_type,guide_id,guide_pic
reading_guide,guide_title,guide_type,guide_id,guide_pic
,ver_label_id
</sql>
</sql>
<sql
id=
"Base_Column_List_own"
>
<sql
id=
"Base_Column_List_own"
>
r.id, r.introduce, r.detail, r.count, r.first_classify, r.second_classify, r.grade_label_id, r.subject_label_id,
r.id, r.introduce, r.detail, r.count, r.first_classify, r.second_classify, r.grade_label_id, r.subject_label_id,
r.create_time, r.update_time, r.enable_group_service, r.rights_setting_type, r.book_id
r.create_time, r.update_time, r.enable_group_service, r.rights_setting_type, r.book_id
,r.online_course_open,r.learning_tool_open,r.draw_open,r.read_type_title,r.vol_label_id
,r.online_course_open,r.learning_tool_open,r.draw_open,r.read_type_title,r.vol_label_id
,r.ver_label_id
</sql>
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Long"
>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Long"
>
...
@@ -83,13 +85,13 @@
...
@@ -83,13 +85,13 @@
grade_label_id, subject_label_id, create_time,
grade_label_id, subject_label_id, create_time,
update_time, enable_group_service, rights_setting_type, book_id,
update_time, enable_group_service, rights_setting_type, book_id,
online_course_open,learning_tool_open,draw_open,read_type_title, vol_label_id,
online_course_open,learning_tool_open,draw_open,read_type_title, vol_label_id,
reading_guide,guide_title,guide_type,guide_id,guide_pic)
reading_guide,guide_title,guide_type,guide_id,guide_pic
,ver_label_id
)
values ( #{introduce,jdbcType=VARCHAR}, #{detail,jdbcType=VARCHAR},
values ( #{introduce,jdbcType=VARCHAR}, #{detail,jdbcType=VARCHAR},
#{count,jdbcType=INTEGER}, #{firstClassify,jdbcType=BIGINT}, #{secondClassify,jdbcType=BIGINT},
#{count,jdbcType=INTEGER}, #{firstClassify,jdbcType=BIGINT}, #{secondClassify,jdbcType=BIGINT},
#{gradeLabelId,jdbcType=BIGINT}, #{subjectLabelId,jdbcType=BIGINT}, now(),
#{gradeLabelId,jdbcType=BIGINT}, #{subjectLabelId,jdbcType=BIGINT}, now(),
#{updateTime,jdbcType=TIMESTAMP}, #{enableGroupService}, #{rightsSettingType}, #{bookId},
#{updateTime,jdbcType=TIMESTAMP}, #{enableGroupService}, #{rightsSettingType}, #{bookId},
#{onlineCourseOpen},#{learningToolOpen},#{drawNowOpen},#{readTypeTitle}, #{volLabelId},
#{onlineCourseOpen},#{learningToolOpen},#{drawNowOpen},#{readTypeTitle}, #{volLabelId},
#{guideIsOpen},#{guideTitle},#{guideType},#{guideId},#{guidePic})
#{guideIsOpen},#{guideTitle},#{guideType},#{guideId},#{guidePic}
, #{verLabelId}
)
</insert>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.pcloud.book.rightsSetting.entity.RightsSetting"
>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.pcloud.book.rightsSetting.entity.RightsSetting"
>
update rights_setting
update rights_setting
...
@@ -155,7 +157,10 @@
...
@@ -155,7 +157,10 @@
guide_id = #{guideId,jdbcType=BIGINT},
guide_id = #{guideId,jdbcType=BIGINT},
</if>
</if>
<if
test=
"guidePic != null"
>
<if
test=
"guidePic != null"
>
guide_pic = #{guidePic,jdbcType=VARCHAR}
guide_pic = #{guidePic,jdbcType=VARCHAR},
</if>
<if
test=
"verLabelId != null"
>
ver_label_id = #{verLabelId,jdbcType=BIGINT}
</if>
</if>
</set>
</set>
where id = #{id,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
...
@@ -181,7 +186,8 @@
...
@@ -181,7 +186,8 @@
guide_title = #{guideTitle,jdbcType=VARCHAR},
guide_title = #{guideTitle,jdbcType=VARCHAR},
guide_type = #{guideType,jdbcType=VARCHAR},
guide_type = #{guideType,jdbcType=VARCHAR},
guide_id = #{guideId,jdbcType=BIGINT},
guide_id = #{guideId,jdbcType=BIGINT},
guide_pic = #{guidePic,jdbcType=VARCHAR}
guide_pic = #{guidePic,jdbcType=VARCHAR},
ver_label_id = #{verLabelId,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</update>
...
@@ -219,6 +225,9 @@
...
@@ -219,6 +225,9 @@
<if
test=
"volLabelId != null"
>
<if
test=
"volLabelId != null"
>
and vol_label_id = #{volLabelId}
and vol_label_id = #{volLabelId}
</if>
</if>
<if
test=
"verLabelId != null"
>
and r.ver_label_id = #{verLabelId,jdbcType=BIGINT}
</if>
</where>
</where>
order by r.create_time desc
order by r.create_time desc
</select>
</select>
...
@@ -226,7 +235,8 @@
...
@@ -226,7 +235,8 @@
<select
id=
"listBookRightsSettingPage"
parameterType=
"map"
resultMap=
"DtoResultMap4Book"
>
<select
id=
"listBookRightsSettingPage"
parameterType=
"map"
resultMap=
"DtoResultMap4Book"
>
select
select
r.id, r.introduce, r.detail, r.count, r.first_classify, r.second_classify, r.grade_label_id, r.subject_label_id,
r.id, r.introduce, r.detail, r.count, r.first_classify, r.second_classify, r.grade_label_id, r.subject_label_id,
r.create_time, r.update_time, r.enable_group_service, r.rights_setting_type, r.book_id, b.BOOK_NAME, r.vol_label_id
r.create_time, r.update_time, r.enable_group_service, r.rights_setting_type, r.book_id, b.BOOK_NAME, r.vol_label_id,
r.ver_label_id
from
from
rights_setting r
rights_setting r
left join rights_setting_book_relation s on r.id = s.rights_setting_id
left join rights_setting_book_relation s on r.id = s.rights_setting_id
...
@@ -262,6 +272,9 @@
...
@@ -262,6 +272,9 @@
<if
test=
"volLabelId != null"
>
<if
test=
"volLabelId != null"
>
and vol_label_id = #{volLabelId}
and vol_label_id = #{volLabelId}
</if>
</if>
<if
test=
"verLabelId != null"
>
and ver_label_id = #{verLabelId,jdbcType=BIGINT}
</if>
limit 1
limit 1
</select>
</select>
...
...
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