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
451e7d99
Commit
451e7d99
authored
Dec 15, 2020
by
吴博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: [1004027] 书刊权益列表
parent
8346af1e
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
673 additions
and
68 deletions
+673
-68
BookBizImpl.java
.../main/java/com/pcloud/book/book/biz/impl/BookBizImpl.java
+2
-1
RightsSettingBizImpl.java
...oud/book/rightsSetting/biz/impl/RightsSettingBizImpl.java
+316
-24
RightsSettingDAO.java
...a/com/pcloud/book/rightsSetting/dao/RightsSettingDAO.java
+2
-0
RightsSettingDAOImpl.java
...oud/book/rightsSetting/dao/impl/RightsSettingDAOImpl.java
+5
-0
RightsSettingDto.java
...a/com/pcloud/book/rightsSetting/dto/RightsSettingDto.java
+2
-10
RightsSetting.java
...a/com/pcloud/book/rightsSetting/entity/RightsSetting.java
+69
-0
RightsSettingBookRelation.java
.../book/rightsSetting/entity/RightsSettingBookRelation.java
+111
-0
RightsSettingFacede.java
...pcloud/book/rightsSetting/facade/RightsSettingFacede.java
+10
-3
Book.Mapper.xml
...rvice-book/src/main/resources/mapper/book/Book.Mapper.xml
+9
-1
RightsSettingBookRelationMapper.xml
.../mapper/rightssetting/RightsSettingBookRelationMapper.xml
+101
-20
RightsSettingMapper.xml
...in/resources/mapper/rightssetting/RightsSettingMapper.xml
+46
-9
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookBizImpl.java
View file @
451e7d99
...
...
@@ -2402,7 +2402,6 @@ public class BookBizImpl implements BookBiz {
}
}
});
}
@Override
...
...
@@ -2508,6 +2507,8 @@ public class BookBizImpl implements BookBiz {
}
PageBeanNew
<
BookDto
>
page
=
bookDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
map
,
"getAdviserBooks4Rights"
);
fillBookInfo
(
page
.
getRecordList
());
bookSet
.
setProDepPurLabelNames
(
page
.
getRecordList
());
bookSet
.
setLabelNames
(
page
.
getRecordList
());
return
page
;
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/biz/impl/RightsSettingBizImpl.java
View file @
451e7d99
...
...
@@ -43,6 +43,7 @@ import com.pcloud.book.consumer.erp.ErpConsr;
import
com.pcloud.book.consumer.reader.ReaderConsr
;
import
com.pcloud.book.consumer.resource.ProductConsr
;
import
com.pcloud.book.consumer.user.AdviserConsr
;
import
com.pcloud.book.consumer.user.PartyConsr
;
import
com.pcloud.book.cultivate.enums.ReadTypeEnum
;
import
com.pcloud.book.custom.biz.CustomPlanBiz
;
import
com.pcloud.book.custom.entity.CustomPlan
;
...
...
@@ -107,18 +108,22 @@ import com.pcloud.book.skill.dto.GroupActivity4AppletDTO;
import
com.pcloud.book.util.common.YesOrNoEnums
;
import
com.pcloud.channelcenter.qrcode.dto.QrcodeSceneDto
;
import
com.pcloud.channelcenter.wechat.dto.AccountSettingDto
;
import
com.pcloud.comment.base.enums.SysCodeEnum
;
import
com.pcloud.common.constant.CacheConstant
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.core.constant.ProductTypeConstant
;
import
com.pcloud.common.core.constant.SystemCode
;
import
com.pcloud.common.enums.AppTypeEnum
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.utils.BeanUtils
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.NumberUtil
;
import
com.pcloud.common.utils.ResponseHandleUtil
;
import
com.pcloud.common.utils.cache.redis.JedisClusterUtils
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.common.utils.string.StringUtilParent
;
import
com.pcloud.labelcenter.label.service.LabelService
;
import
com.pcloud.resourcecenter.product.dto.ProductDto
;
import
com.pcloud.usercenter.party.adviser.dto.AdviserBaseInfoDto
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -241,6 +246,10 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
private
AppletThirdResourcesDao
appletThirdResourcesDao
;
@Autowired
private
BookGroupDao
bookGroupDao
;
@Autowired
private
LabelService
labelService
;
@Autowired
private
PartyConsr
partyConsr
;
@Override
@ParamLog
(
"新增权益设置"
)
...
...
@@ -363,15 +372,19 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
}
else
if
(
Objects
.
equals
(
RightsTypeEnum
.
NOW
.
code
,
rightsSetting
.
getStepType
()))
{
//更新即享权益
updateRightNowItemByRightId
(
rightsSetting
);
rightsSettingDAO
.
updateUser
(
rightsSetting
);
}
else
if
(
Objects
.
equals
(
RightsTypeEnum
.
WEEK
.
code
,
rightsSetting
.
getStepType
()))
{
// 更新每周、长期权益
updateRightsWeek
(
rightsSetting
);
rightsSettingDAO
.
updateUser
(
rightsSetting
);
}
else
if
(
Objects
.
equals
(
RightsTypeEnum
.
LONG_TERM
.
code
,
rightsSetting
.
getStepType
()))
{
// 更新每周、长期权益
updateRightsLongTerm
(
rightsSetting
);
rightsSettingDAO
.
updateUser
(
rightsSetting
);
}
else
if
(
Objects
.
equals
(
RightsTypeEnum
.
UP_NUMBER
.
code
,
rightsSetting
.
getStepType
()))
{
// 更新每周、长期权益
updateNumber
(
rightsSetting
);
rightsSettingDAO
.
updateUser
(
rightsSetting
);
}
}
...
...
@@ -816,10 +829,112 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
setReadType
(
rightsSetting
);
//设置阅读指引
fillReadGuide
(
rightsSetting
);
//填充分类及标签
fillLabelNames
(
Lists
.
newArrayList
(
rightsSetting
));
return
rightsSetting
;
}
private
void
fillLabelNames
(
List
<
RightsSetting
>
rightsSettingList
)
{
if
(
ListUtils
.
isEmpty
(
rightsSettingList
))
{
return
;
}
List
<
Long
>
classifyIds
=
new
ArrayList
<>();
List
<
Long
>
bookLabelIds
=
new
ArrayList
<>();
List
<
Long
>
labelIds
=
new
ArrayList
<>();
rightsSettingList
.
stream
().
forEach
(
rightsSetting
->
{
if
(
null
==
rightsSetting
||
ListUtils
.
isEmpty
(
rightsSetting
.
getRightsSettingBookRelations
()))
{
return
;
}
List
<
RightsSettingBookRelation
>
rightsSettingBookRelations
=
rightsSetting
.
getRightsSettingBookRelations
();
rightsSettingBookRelations
.
stream
().
forEach
(
rightsSettingBookRelation
->
{
if
(
null
!=
rightsSettingBookRelation
.
getTempletId
())
{
classifyIds
.
add
(
rightsSettingBookRelation
.
getTempletId
());
}
if
(
null
!=
rightsSettingBookRelation
.
getSecondTempletId
())
{
classifyIds
.
add
(
rightsSettingBookRelation
.
getSecondTempletId
());
}
if
(
null
!=
rightsSettingBookRelation
.
getGraLabelId
())
{
bookLabelIds
.
add
(
rightsSettingBookRelation
.
getGraLabelId
());
}
if
(
null
!=
rightsSettingBookRelation
.
getSubLabelId
())
{
bookLabelIds
.
add
(
rightsSettingBookRelation
.
getSubLabelId
());
}
if
(
null
!=
rightsSettingBookRelation
.
getVolLabelId
())
{
bookLabelIds
.
add
(
rightsSettingBookRelation
.
getVolLabelId
());
}
if
(
null
!=
rightsSettingBookRelation
.
getVerLabelId
()){
bookLabelIds
.
add
(
rightsSettingBookRelation
.
getVerLabelId
());
}
if
(
null
!=
rightsSettingBookRelation
.
getAreaLabelId
())
{
bookLabelIds
.
add
(
rightsSettingBookRelation
.
getAreaLabelId
());
}
if
(
rightsSettingBookRelation
.
getProLabelId
()
!=
null
)
{
labelIds
.
add
(
rightsSettingBookRelation
.
getProLabelId
());
}
if
(
rightsSettingBookRelation
.
getPurLabelId
()
!=
null
)
{
labelIds
.
add
(
rightsSettingBookRelation
.
getPurLabelId
());
}
if
(
rightsSettingBookRelation
.
getDepLabelId
()
!=
null
)
{
labelIds
.
add
(
rightsSettingBookRelation
.
getDepLabelId
());
}
});
});
Map
<
Long
,
AssistTempletDTO
>
classifyMap
=
new
HashMap
<>();
Map
<
Long
,
BookLabel
>
bookLabelMap
=
new
HashMap
<>();
Map
<
Long
,
String
>
labelMap
=
new
HashMap
<>();
if
(!
ListUtils
.
isEmpty
(
classifyIds
))
{
classifyMap
=
assistTempletConsr
.
mapByIds4Classify
(
classifyIds
);
}
if
(!
ListUtils
.
isEmpty
(
bookLabelIds
))
{
bookLabelMap
=
bookLabelDao
.
getMapByIds
(
bookLabelIds
);
}
if
(!
ListUtils
.
isEmpty
(
labelIds
))
{
labelMap
=
ResponseHandleUtil
.
parseMap
(
labelService
.
getLabelName
(
labelIds
),
Long
.
class
,
String
.
class
);
}
for
(
RightsSetting
rightsSetting
:
rightsSettingList
)
{
if
(
null
==
rightsSetting
||
ListUtils
.
isEmpty
(
rightsSetting
.
getRightsSettingBookRelations
()))
{
continue
;
}
List
<
RightsSettingBookRelation
>
rightsSettingBookRelations
=
rightsSetting
.
getRightsSettingBookRelations
();
for
(
RightsSettingBookRelation
rightsSettingBookRelation
:
rightsSettingBookRelations
)
{
if
(!
MapUtils
.
isEmpty
(
classifyMap
)
&&
classifyMap
.
containsKey
(
rightsSettingBookRelation
.
getTempletId
()))
{
rightsSettingBookRelation
.
setTempletName
(
classifyMap
.
get
(
rightsSettingBookRelation
.
getTempletId
()).
getTempletName
());
}
if
(!
MapUtils
.
isEmpty
(
classifyMap
)
&&
classifyMap
.
containsKey
(
rightsSettingBookRelation
.
getSecondTempletId
()))
{
rightsSettingBookRelation
.
setSecondTempletName
(
classifyMap
.
get
(
rightsSettingBookRelation
.
getSecondTempletId
()).
getTempletName
());
}
if
(!
MapUtils
.
isEmpty
(
bookLabelMap
)
&&
bookLabelMap
.
containsKey
(
rightsSettingBookRelation
.
getGraLabelId
()))
{
rightsSettingBookRelation
.
setGraLabelName
(
bookLabelMap
.
get
(
rightsSettingBookRelation
.
getGraLabelId
()).
getName
());
}
if
(!
MapUtils
.
isEmpty
(
bookLabelMap
)
&&
bookLabelMap
.
containsKey
(
rightsSettingBookRelation
.
getSubLabelId
()))
{
rightsSettingBookRelation
.
setSubLabelName
(
bookLabelMap
.
get
(
rightsSettingBookRelation
.
getSubLabelId
()).
getName
());
}
if
(!
MapUtils
.
isEmpty
(
bookLabelMap
)
&&
bookLabelMap
.
containsKey
(
rightsSettingBookRelation
.
getVolLabelId
()))
{
rightsSettingBookRelation
.
setVolLabelName
(
bookLabelMap
.
get
(
rightsSettingBookRelation
.
getVolLabelId
()).
getName
());
}
if
(!
MapUtils
.
isEmpty
(
bookLabelMap
)
&&
bookLabelMap
.
containsKey
(
rightsSettingBookRelation
.
getVerLabelId
()))
{
rightsSettingBookRelation
.
setVerLabelName
(
bookLabelMap
.
get
(
rightsSettingBookRelation
.
getVerLabelId
()).
getName
());
}
if
(!
MapUtils
.
isEmpty
(
bookLabelMap
)
&&
bookLabelMap
.
containsKey
(
rightsSettingBookRelation
.
getAreaLabelId
()))
{
rightsSettingBookRelation
.
setAreaLabelName
(
bookLabelMap
.
get
(
rightsSettingBookRelation
.
getAreaLabelId
()).
getName
());
}
//设置深度标签
if
(!
MapUtils
.
isEmpty
(
labelMap
)
&&
labelMap
.
containsKey
(
rightsSettingBookRelation
.
getDepLabelId
()))
{
rightsSettingBookRelation
.
setDepLabelName
(
labelMap
.
get
(
rightsSettingBookRelation
.
getDepLabelId
()));
}
if
(!
MapUtils
.
isEmpty
(
labelMap
)
&&
labelMap
.
containsKey
(
rightsSettingBookRelation
.
getPurLabelId
()))
{
rightsSettingBookRelation
.
setPurLabelName
(
labelMap
.
get
(
rightsSettingBookRelation
.
getPurLabelId
()));
}
if
(!
MapUtils
.
isEmpty
(
labelMap
)
&&
labelMap
.
containsKey
(
rightsSettingBookRelation
.
getProLabelId
()))
{
rightsSettingBookRelation
.
setProLabelName
(
labelMap
.
get
(
rightsSettingBookRelation
.
getProLabelId
()));
}
}
}
}
private
void
fillReadGuide
(
RightsSetting
rightsSetting
){
RightsNowItem
rightsNowItem
=
new
RightsNowItem
();
...
...
@@ -925,9 +1040,9 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
}
List
<
Long
>
bookIds
=
rightsSettingBookRelations
.
stream
().
map
(
e
->
e
.
getBookId
()).
collect
(
Collectors
.
toList
());
List
<
Long
>
adviserIds
=
rightsSettingBookRelations
.
stream
().
map
(
e
->
e
.
getAdviserId
()).
collect
(
Collectors
.
toList
());
Map
<
Long
,
String
>
adviserNameMap
=
new
HashMap
<>(
);
if
(
!
ListUtils
.
isEmpty
(
adviserIds
))
{
adviserNameMap
=
adviserConsr
.
getNames
(
adviserIds
)
;
Map
<
Long
,
AdviserBaseInfoDto
>
infoDtoMap
=
adviserConsr
.
getAdviserId2AdviserInfoDtoMap
(
adviserIds
);
if
(
MapUtils
.
isEmpty
(
infoDtoMap
))
{
return
;
}
Map
<
Long
,
BookDto
>
bookDtoMap
=
bookBiz
.
getListByIds
(
bookIds
);
if
(
MapUtils
.
isEmpty
(
bookDtoMap
))
{
...
...
@@ -939,8 +1054,9 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
rightsSettingBookRelation
.
setBookName
(
bookDtoMap
.
get
(
rightsSettingBookRelation
.
getBookId
()).
getBookName
());
rightsSettingBookRelation
.
setIsbn
(
bookDtoMap
.
get
(
rightsSettingBookRelation
.
getBookId
()).
getIsbn
());
}
if
(
MapUtils
.
isNotEmpty
(
adviserNameMap
)
&&
null
!=
adviserNameMap
.
get
(
rightsSettingBookRelation
.
getAdviserId
()))
{
rightsSettingBookRelation
.
setAdviserName
(
adviserNameMap
.
get
(
rightsSettingBookRelation
.
getAdviserId
()));
if
(
MapUtils
.
isNotEmpty
(
infoDtoMap
)
&&
null
!=
infoDtoMap
.
get
(
rightsSettingBookRelation
.
getAdviserId
()))
{
rightsSettingBookRelation
.
setAdviserName
(
infoDtoMap
.
get
(
rightsSettingBookRelation
.
getAdviserId
()).
getPartyName
());
rightsSettingBookRelation
.
setAgentName
(
infoDtoMap
.
get
(
rightsSettingBookRelation
.
getAdviserId
()).
getAgentName
());
}
}
rightsSetting
.
setRightsSettingBookRelations
(
rightsSettingBookRelations
);
...
...
@@ -1809,10 +1925,18 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
paramMap
.
put
(
"adviserIds"
,
adviserIds
);
}
}
paramMap
.
put
(
"firstClassify"
,
rightsSetting
.
getFirstClassify
());
paramMap
.
put
(
"secondClassify"
,
rightsSetting
.
getSecondClassify
());
paramMap
.
put
(
"gradeLabelId"
,
rightsSetting
.
getGradeLabelId
());
paramMap
.
put
(
"subjectLabelId"
,
rightsSetting
.
getSubjectLabelId
());
paramMap
.
put
(
"volLabelId"
,
rightsSetting
.
getVolLabelId
());
paramMap
.
put
(
"verLabelId"
,
rightsSetting
.
getVerLabelId
());
rightsSettingDtoPageBeanNew
=
rightsSettingDAO
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
paramMap
,
"listBookRightsSettingPage"
);
//填充编辑名称
fillAdviserName
(
rightsSettingDtoPageBeanNew
.
getRecordList
());
fillPartyName
(
rightsSettingDtoPageBeanNew
.
getRecordList
());
fillLabelNames4DTO
(
rightsSettingDtoPageBeanNew
.
getRecordList
());
}
else
{
paramMap
.
put
(
"firstClassify"
,
rightsSetting
.
getFirstClassify
());
paramMap
.
put
(
"secondClassify"
,
rightsSetting
.
getSecondClassify
());
...
...
@@ -1827,9 +1951,144 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
List
<
RightsSettingDto
>
rightsSettingDtos
=
rightsSettingDtoPageBeanNew
.
getRecordList
();
setLabelContent
(
rightsSettingDtos
);
}
return
rightsSettingDtoPageBeanNew
;
}
private
void
fillLabelNames4DTO
(
List
<
RightsSettingDto
>
rightsSettingList
)
{
if
(
ListUtils
.
isEmpty
(
rightsSettingList
))
{
return
;
}
List
<
Long
>
classifyIds
=
new
ArrayList
<>();
List
<
Long
>
bookLabelIds
=
new
ArrayList
<>();
List
<
Long
>
labelIds
=
new
ArrayList
<>();
rightsSettingList
.
stream
().
forEach
(
rightsSetting
->
{
if
(
null
==
rightsSetting
||
ListUtils
.
isEmpty
(
rightsSetting
.
getRightsSettingBookRelations
()))
{
return
;
}
List
<
RightsSettingBookRelation
>
rightsSettingBookRelations
=
rightsSetting
.
getRightsSettingBookRelations
();
rightsSettingBookRelations
.
stream
().
forEach
(
rightsSettingBookRelation
->
{
if
(
null
!=
rightsSettingBookRelation
.
getTempletId
())
{
classifyIds
.
add
(
rightsSettingBookRelation
.
getTempletId
());
}
if
(
null
!=
rightsSettingBookRelation
.
getSecondTempletId
())
{
classifyIds
.
add
(
rightsSettingBookRelation
.
getSecondTempletId
());
}
if
(
null
!=
rightsSettingBookRelation
.
getGraLabelId
())
{
bookLabelIds
.
add
(
rightsSettingBookRelation
.
getGraLabelId
());
}
if
(
null
!=
rightsSettingBookRelation
.
getSubLabelId
())
{
bookLabelIds
.
add
(
rightsSettingBookRelation
.
getSubLabelId
());
}
if
(
null
!=
rightsSettingBookRelation
.
getVolLabelId
())
{
bookLabelIds
.
add
(
rightsSettingBookRelation
.
getVolLabelId
());
}
if
(
null
!=
rightsSettingBookRelation
.
getVerLabelId
()){
bookLabelIds
.
add
(
rightsSettingBookRelation
.
getVerLabelId
());
}
if
(
null
!=
rightsSettingBookRelation
.
getAreaLabelId
())
{
bookLabelIds
.
add
(
rightsSettingBookRelation
.
getAreaLabelId
());
}
if
(
rightsSettingBookRelation
.
getProLabelId
()
!=
null
)
{
labelIds
.
add
(
rightsSettingBookRelation
.
getProLabelId
());
}
if
(
rightsSettingBookRelation
.
getPurLabelId
()
!=
null
)
{
labelIds
.
add
(
rightsSettingBookRelation
.
getPurLabelId
());
}
if
(
rightsSettingBookRelation
.
getDepLabelId
()
!=
null
)
{
labelIds
.
add
(
rightsSettingBookRelation
.
getDepLabelId
());
}
});
});
Map
<
Long
,
AssistTempletDTO
>
classifyMap
=
new
HashMap
<>();
Map
<
Long
,
BookLabel
>
bookLabelMap
=
new
HashMap
<>();
Map
<
Long
,
String
>
labelMap
=
new
HashMap
<>();
if
(!
ListUtils
.
isEmpty
(
classifyIds
))
{
classifyMap
=
assistTempletConsr
.
mapByIds4Classify
(
classifyIds
);
}
if
(!
ListUtils
.
isEmpty
(
bookLabelIds
))
{
bookLabelMap
=
bookLabelDao
.
getMapByIds
(
bookLabelIds
);
}
if
(!
ListUtils
.
isEmpty
(
labelIds
))
{
labelMap
=
ResponseHandleUtil
.
parseMap
(
labelService
.
getLabelName
(
labelIds
),
Long
.
class
,
String
.
class
);
}
for
(
RightsSettingDto
rightsSetting
:
rightsSettingList
)
{
if
(
null
==
rightsSetting
||
ListUtils
.
isEmpty
(
rightsSetting
.
getRightsSettingBookRelations
()))
{
continue
;
}
List
<
RightsSettingBookRelation
>
rightsSettingBookRelations
=
rightsSetting
.
getRightsSettingBookRelations
();
for
(
RightsSettingBookRelation
rightsSettingBookRelation
:
rightsSettingBookRelations
)
{
if
(!
MapUtils
.
isEmpty
(
classifyMap
)
&&
classifyMap
.
containsKey
(
rightsSettingBookRelation
.
getTempletId
()))
{
rightsSettingBookRelation
.
setTempletName
(
classifyMap
.
get
(
rightsSettingBookRelation
.
getTempletId
()).
getTempletName
());
}
if
(!
MapUtils
.
isEmpty
(
classifyMap
)
&&
classifyMap
.
containsKey
(
rightsSettingBookRelation
.
getSecondTempletId
()))
{
rightsSettingBookRelation
.
setSecondTempletName
(
classifyMap
.
get
(
rightsSettingBookRelation
.
getSecondTempletId
()).
getTempletName
());
}
if
(!
MapUtils
.
isEmpty
(
bookLabelMap
)
&&
bookLabelMap
.
containsKey
(
rightsSettingBookRelation
.
getGraLabelId
()))
{
rightsSettingBookRelation
.
setGraLabelName
(
bookLabelMap
.
get
(
rightsSettingBookRelation
.
getGraLabelId
()).
getName
());
}
if
(!
MapUtils
.
isEmpty
(
bookLabelMap
)
&&
bookLabelMap
.
containsKey
(
rightsSettingBookRelation
.
getSubLabelId
()))
{
rightsSettingBookRelation
.
setSubLabelName
(
bookLabelMap
.
get
(
rightsSettingBookRelation
.
getSubLabelId
()).
getName
());
}
if
(!
MapUtils
.
isEmpty
(
bookLabelMap
)
&&
bookLabelMap
.
containsKey
(
rightsSettingBookRelation
.
getVolLabelId
()))
{
rightsSettingBookRelation
.
setVolLabelName
(
bookLabelMap
.
get
(
rightsSettingBookRelation
.
getVolLabelId
()).
getName
());
}
if
(!
MapUtils
.
isEmpty
(
bookLabelMap
)
&&
bookLabelMap
.
containsKey
(
rightsSettingBookRelation
.
getVerLabelId
()))
{
rightsSettingBookRelation
.
setVerLabelName
(
bookLabelMap
.
get
(
rightsSettingBookRelation
.
getVerLabelId
()).
getName
());
}
if
(!
MapUtils
.
isEmpty
(
bookLabelMap
)
&&
bookLabelMap
.
containsKey
(
rightsSettingBookRelation
.
getAreaLabelId
()))
{
rightsSettingBookRelation
.
setAreaLabelName
(
bookLabelMap
.
get
(
rightsSettingBookRelation
.
getAreaLabelId
()).
getName
());
}
//设置深度标签
if
(!
MapUtils
.
isEmpty
(
labelMap
)
&&
labelMap
.
containsKey
(
rightsSettingBookRelation
.
getDepLabelId
()))
{
rightsSettingBookRelation
.
setDepLabelName
(
labelMap
.
get
(
rightsSettingBookRelation
.
getDepLabelId
()));
}
if
(!
MapUtils
.
isEmpty
(
labelMap
)
&&
labelMap
.
containsKey
(
rightsSettingBookRelation
.
getPurLabelId
()))
{
rightsSettingBookRelation
.
setPurLabelName
(
labelMap
.
get
(
rightsSettingBookRelation
.
getPurLabelId
()));
}
if
(!
MapUtils
.
isEmpty
(
labelMap
)
&&
labelMap
.
containsKey
(
rightsSettingBookRelation
.
getProLabelId
()))
{
rightsSettingBookRelation
.
setProLabelName
(
labelMap
.
get
(
rightsSettingBookRelation
.
getProLabelId
()));
}
}
}
}
private
void
fillPartyName
(
List
<
RightsSettingDto
>
recordList
)
{
if
(
ListUtils
.
isEmpty
(
recordList
)
)
{
return
;
}
List
<
Long
>
userIds
=
new
ArrayList
<>();
recordList
.
stream
().
forEach
(
rightsSettingDto
->
{
if
(
null
!=
rightsSettingDto
.
getCreateUserId
())
{
userIds
.
add
(
rightsSettingDto
.
getCreateUserId
());
}
if
(
null
!=
rightsSettingDto
.
getUpdateUserId
())
{
userIds
.
add
(
rightsSettingDto
.
getUpdateUserId
());
}
});
if
(
ListUtils
.
isEmpty
(
userIds
))
{
return
;
}
Map
<
Long
,
String
>
userNamesMap
=
partyConsr
.
getAllUserLoginName
(
0L
,
SystemCode
.
pcloud
.
code
);
if
(
MapUtils
.
isEmpty
(
userNamesMap
))
{
return
;
}
recordList
.
stream
().
forEach
(
rightsSettingDto
->
{
if
(
null
!=
rightsSettingDto
.
getCreateUserId
())
{
rightsSettingDto
.
setCreateUserName
(
userNamesMap
.
get
(
rightsSettingDto
.
getCreateUserId
()));
}
if
(
null
!=
rightsSettingDto
.
getUpdateUserId
())
{
rightsSettingDto
.
setUpdateUserName
(
userNamesMap
.
get
(
rightsSettingDto
.
getUpdateUserId
()));
}
});
}
private
void
fillAdviserName
(
List
<
RightsSettingDto
>
recordList
)
{
if
(
ListUtils
.
isEmpty
(
recordList
)
)
{
return
;
...
...
@@ -1845,8 +2104,8 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
if
(
ListUtils
.
isEmpty
(
adviserIds
))
{
return
;
}
Map
<
Long
,
String
>
adviserNameMap
=
adviserConsr
.
getNames
(
adviserIds
);
if
(
MapUtils
.
isEmpty
(
adviserName
Map
))
{
Map
<
Long
,
AdviserBaseInfoDto
>
infoDtoMap
=
adviserConsr
.
getAdviserId2AdviserInfoDtoMap
(
adviserIds
);
if
(
MapUtils
.
isEmpty
(
infoDto
Map
))
{
return
;
}
recordList
.
forEach
(
rightsSettingDto
->
{
...
...
@@ -1854,8 +2113,10 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
if
(
ListUtils
.
isEmpty
(
rightsSettingBookRelations
))
{
return
;
}
rightsSettingBookRelations
.
stream
().
forEach
(
rightsSettingBookRelation
->
rightsSettingBookRelation
.
setAdviserName
(
adviserNameMap
.
get
(
rightsSettingBookRelation
.
getAdviserId
())));
rightsSettingBookRelations
.
stream
().
forEach
(
rightsSettingBookRelation
->
{
rightsSettingBookRelation
.
setAdviserName
(
infoDtoMap
.
get
(
rightsSettingBookRelation
.
getAdviserId
()).
getPartyName
());
rightsSettingBookRelation
.
setAgentName
(
infoDtoMap
.
get
(
rightsSettingBookRelation
.
getAdviserId
()).
getAgentName
());
});
});
}
...
...
@@ -1897,6 +2158,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
return
;
}
List
<
Long
>
classifyIds
=
new
ArrayList
<>();
List
<
Long
>
bookLabelIds
=
new
ArrayList
<>();
List
<
Long
>
labelIds
=
new
ArrayList
<>();
for
(
RightsSettingDto
rightsSettingDto
:
rightsSettingDtos
)
{
if
(
null
!=
rightsSettingDto
.
getFirstClassify
())
{
...
...
@@ -1906,25 +2168,42 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
classifyIds
.
add
(
rightsSettingDto
.
getSecondClassify
());
}
if
(
null
!=
rightsSettingDto
.
getGradeLabelId
())
{
l
abelIds
.
add
(
rightsSettingDto
.
getGradeLabelId
());
bookL
abelIds
.
add
(
rightsSettingDto
.
getGradeLabelId
());
}
if
(
null
!=
rightsSettingDto
.
getSubjectLabelId
())
{
l
abelIds
.
add
(
rightsSettingDto
.
getSubjectLabelId
());
bookL
abelIds
.
add
(
rightsSettingDto
.
getSubjectLabelId
());
}
if
(
null
!=
rightsSettingDto
.
getVolLabelId
())
{
l
abelIds
.
add
(
rightsSettingDto
.
getVolLabelId
());
bookL
abelIds
.
add
(
rightsSettingDto
.
getVolLabelId
());
}
if
(
null
!=
rightsSettingDto
.
getVerLabelId
()){
labelIds
.
add
(
rightsSettingDto
.
getVerLabelId
());
bookLabelIds
.
add
(
rightsSettingDto
.
getVerLabelId
());
}
if
(
null
!=
rightsSettingDto
.
getAreaLabelId
()){
bookLabelIds
.
add
(
rightsSettingDto
.
getAreaLabelId
());
}
if
(
rightsSettingDto
.
getProLabelId
()
!=
null
)
{
labelIds
.
add
(
rightsSettingDto
.
getProLabelId
());
}
if
(
rightsSettingDto
.
getPurLabelId
()
!=
null
)
{
labelIds
.
add
(
rightsSettingDto
.
getPurLabelId
());
}
if
(
rightsSettingDto
.
getDepLabelId
()
!=
null
)
{
labelIds
.
add
(
rightsSettingDto
.
getDepLabelId
());
}
}
Map
<
Long
,
AssistTempletDTO
>
classifyMap
=
new
HashMap
<>();
Map
<
Long
,
BookLabel
>
labelMap
=
new
HashMap
<>();
Map
<
Long
,
BookLabel
>
bookLabelMap
=
new
HashMap
<>();
Map
<
Long
,
String
>
labelMap
=
new
HashMap
<>();
if
(!
ListUtils
.
isEmpty
(
classifyIds
))
{
classifyMap
=
assistTempletConsr
.
mapByIds4Classify
(
classifyIds
);
}
if
(!
ListUtils
.
isEmpty
(
bookLabelIds
))
{
bookLabelMap
=
bookLabelDao
.
getMapByIds
(
bookLabelIds
);
}
if
(!
ListUtils
.
isEmpty
(
labelIds
))
{
labelMap
=
bookLabelDao
.
getMapByIds
(
labelId
s
);
labelMap
=
ResponseHandleUtil
.
parseMap
(
labelService
.
getLabelName
(
labelIds
),
Long
.
class
,
String
.
clas
s
);
}
for
(
RightsSettingDto
rightsSettingDto
:
rightsSettingDtos
)
{
if
(!
MapUtils
.
isEmpty
(
classifyMap
)
&&
classifyMap
.
containsKey
(
rightsSettingDto
.
getFirstClassify
()))
{
...
...
@@ -1933,17 +2212,30 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
if
(!
MapUtils
.
isEmpty
(
classifyMap
)
&&
classifyMap
.
containsKey
(
rightsSettingDto
.
getSecondClassify
()))
{
rightsSettingDto
.
setSecondClassifyContent
(
classifyMap
.
get
(
rightsSettingDto
.
getSecondClassify
()).
getTempletName
());
}
if
(!
MapUtils
.
isEmpty
(
labelMap
)
&&
labelMap
.
containsKey
(
rightsSettingDto
.
getGradeLabelId
()))
{
rightsSettingDto
.
setGradeLabelIdContent
(
labelMap
.
get
(
rightsSettingDto
.
getGradeLabelId
()).
getName
());
if
(!
MapUtils
.
isEmpty
(
bookLabelMap
)
&&
bookLabelMap
.
containsKey
(
rightsSettingDto
.
getGradeLabelId
()))
{
rightsSettingDto
.
setGradeLabelIdContent
(
bookLabelMap
.
get
(
rightsSettingDto
.
getGradeLabelId
()).
getName
());
}
if
(!
MapUtils
.
isEmpty
(
bookLabelMap
)
&&
bookLabelMap
.
containsKey
(
rightsSettingDto
.
getSubjectLabelId
()))
{
rightsSettingDto
.
setSubjectLabelIdContent
(
bookLabelMap
.
get
(
rightsSettingDto
.
getSubjectLabelId
()).
getName
());
}
if
(!
MapUtils
.
isEmpty
(
bookLabelMap
)
&&
bookLabelMap
.
containsKey
(
rightsSettingDto
.
getVolLabelId
()))
{
rightsSettingDto
.
setVolLabelContent
(
bookLabelMap
.
get
(
rightsSettingDto
.
getVolLabelId
()).
getName
());
}
if
(!
MapUtils
.
isEmpty
(
bookLabelMap
)
&&
bookLabelMap
.
containsKey
(
rightsSettingDto
.
getVerLabelId
())){
rightsSettingDto
.
setVerLabelContent
(
bookLabelMap
.
get
(
rightsSettingDto
.
getVerLabelId
()).
getName
());
}
if
(!
MapUtils
.
isEmpty
(
bookLabelMap
)
&&
bookLabelMap
.
containsKey
(
rightsSettingDto
.
getAreaLabelId
())){
rightsSettingDto
.
setAreaLabelContent
(
bookLabelMap
.
get
(
rightsSettingDto
.
getAreaLabelId
()).
getName
());
}
if
(!
MapUtils
.
isEmpty
(
labelMap
)
&&
labelMap
.
containsKey
(
rightsSettingDto
.
getSubjectLabelId
()))
{
rightsSettingDto
.
setSubjectLabelIdContent
(
labelMap
.
get
(
rightsSettingDto
.
getSubjectLabelId
()).
getName
());
//设置深度标签
if
(!
MapUtils
.
isEmpty
(
labelMap
)
&&
labelMap
.
containsKey
(
rightsSettingDto
.
getDepLabelId
())){
rightsSettingDto
.
setDepLabelName
(
labelMap
.
get
(
rightsSettingDto
.
getDepLabelId
()));
}
if
(!
MapUtils
.
isEmpty
(
labelMap
)
&&
labelMap
.
containsKey
(
rightsSettingDto
.
get
VolLabelId
()))
{
rightsSettingDto
.
set
VolLabelContent
(
labelMap
.
get
(
rightsSettingDto
.
getVolLabelId
()).
getName
(
));
if
(!
MapUtils
.
isEmpty
(
labelMap
)
&&
labelMap
.
containsKey
(
rightsSettingDto
.
get
PurLabelId
()))
{
rightsSettingDto
.
set
PurLabelName
(
labelMap
.
get
(
rightsSettingDto
.
getPurLabelId
()
));
}
if
(!
MapUtils
.
isEmpty
(
labelMap
)
&&
labelMap
.
containsKey
(
rightsSettingDto
.
get
Ver
LabelId
())){
rightsSettingDto
.
set
VerLabelContent
(
labelMap
.
get
(
rightsSettingDto
.
getVerLabelId
()).
getName
(
));
if
(!
MapUtils
.
isEmpty
(
labelMap
)
&&
labelMap
.
containsKey
(
rightsSettingDto
.
get
Pro
LabelId
())){
rightsSettingDto
.
set
ProLabelName
(
labelMap
.
get
(
rightsSettingDto
.
getProLabelId
()
));
}
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/dao/RightsSettingDAO.java
View file @
451e7d99
...
...
@@ -33,4 +33,6 @@ public interface RightsSettingDAO extends BaseDao<RightsSetting> {
void
batchUpdateShowState
(
RightsSettingShowStateDTO
rightsSettingShowStateDTO
);
Map
<
Long
,
RightsSettingDto
>
listByBookIds
(
List
<
Long
>
bookIds
);
void
updateUser
(
RightsSetting
rightsSetting
);
}
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/dao/impl/RightsSettingDAOImpl.java
View file @
451e7d99
...
...
@@ -86,4 +86,9 @@ public class RightsSettingDAOImpl extends BaseDaoImpl<RightsSetting> implement
public
Map
<
Long
,
RightsSettingDto
>
listByBookIds
(
List
<
Long
>
bookIds
)
{
return
getSessionTemplate
().
selectMap
(
getStatement
(
"listByBookIds"
),
bookIds
,
"bookId"
);
}
@Override
public
void
updateUser
(
RightsSetting
rightsSetting
)
{
getSessionTemplate
().
update
(
getStatement
(
"updateUser"
),
rightsSetting
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/dto/RightsSettingDto.java
View file @
451e7d99
...
...
@@ -9,13 +9,6 @@ public class RightsSettingDto extends RightsSetting {
@ApiModelProperty
(
"权益编号"
)
private
String
rightsNumber
;
private
String
firstClassifyContent
;
private
String
secondClassifyContent
;
private
String
gradeLabelIdContent
;
private
String
subjectLabelIdContent
;
/**
* 权益分类
...
...
@@ -31,9 +24,8 @@ public class RightsSettingDto extends RightsSetting {
*/
private
Integer
chooseReadType
;
private
String
volLabelContent
;
private
String
verLabelContent
;
private
Long
agentId
;
private
String
groupQrcodeUrl
;
}
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/entity/RightsSetting.java
View file @
451e7d99
...
...
@@ -159,6 +159,75 @@ public class RightsSetting extends BaseTempletClassify {
@ApiModelProperty
(
"应用或作品跳转地址"
)
private
String
guideLinkUrl
;
@ApiModelProperty
(
"专业标签ID"
)
private
Long
proLabelId
;
@ApiModelProperty
(
"深度标签ID"
)
private
Long
depLabelId
;
@ApiModelProperty
(
"目的标签ID"
)
private
Long
purLabelId
;
@ApiModelProperty
(
"专业标签名称"
)
private
String
proLabelName
;
@ApiModelProperty
(
"深度标签名称"
)
private
String
depLabelName
;
@ApiModelProperty
(
"目的标签名称"
)
private
String
purLabelName
;
/**
* 年级标签
*/
private
String
graLabelName
;
/**
* 科目标签
*/
private
String
subLabelName
;
/**
* 版本标签
*/
private
String
verLabelName
;
/**
* 地域标签
*/
private
String
areaLabelName
;
/**
* 上下册标签
*/
private
String
volLabelName
;
/**
* 地域标签id
*/
private
Long
areaLabelId
;
private
String
firstClassifyContent
;
private
String
secondClassifyContent
;
private
String
gradeLabelIdContent
;
private
String
subjectLabelIdContent
;
private
String
volLabelContent
;
private
String
verLabelContent
;
private
String
areaLabelContent
;
private
Long
createUserId
;
private
Long
updateUserId
;
private
String
createUserName
;
private
String
updateUserName
;
public
RightsSetting
()
{
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/entity/RightsSettingBookRelation.java
View file @
451e7d99
package
com
.
pcloud
.
book
.
rightsSetting
.
entity
;
import
java.util.Date
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
...
...
@@ -9,10 +12,20 @@ public class RightsSettingBookRelation {
private
Long
rightsSettingId
;
private
Long
bookAdviserId
;
private
Long
bookId
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
createTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
updateTime
;
private
String
bookName
;
...
...
@@ -22,4 +35,101 @@ public class RightsSettingBookRelation {
private
String
adviserName
;
private
String
isbn
;
private
Long
channelId
;
private
Long
agentId
;
private
String
agentName
;
private
String
coverImg
;
/**
* 模板标识
*/
private
Long
templetId
;
/**
* 模板名称
*/
private
String
templetName
;
/**
* 第二级类型
*/
private
Long
secondTempletId
;
/**
* 第二类型名称
*/
private
String
secondTempletName
;
/**
* 年级标签id
*/
private
Long
graLabelId
;
/**
* 科目标签id
*/
private
Long
subLabelId
;
/**
* 版本标签id
*/
private
Long
verLabelId
;
/**
* 地域标签id
*/
private
Long
areaLabelId
;
/**
* 上下册标签id
*/
private
Long
volLabelId
;
/**
* 年级标签
*/
private
String
graLabelName
;
/**
* 科目标签
*/
private
String
subLabelName
;
/**
* 版本标签
*/
private
String
verLabelName
;
/**
* 地域标签
*/
private
String
areaLabelName
;
/**
* 上下册标签
*/
private
String
volLabelName
;
@ApiModelProperty
(
"专业标签ID"
)
private
Long
proLabelId
;
@ApiModelProperty
(
"深度标签ID"
)
private
Long
depLabelId
;
@ApiModelProperty
(
"目的标签ID"
)
private
Long
purLabelId
;
@ApiModelProperty
(
"专业标签名称"
)
private
String
proLabelName
;
@ApiModelProperty
(
"深度标签名称"
)
private
String
depLabelName
;
@ApiModelProperty
(
"目的标签名称"
)
private
String
purLabelName
;
private
String
groupQrcodeUrl
;
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/facade/RightsSettingFacede.java
View file @
451e7d99
...
...
@@ -51,6 +51,8 @@ public class RightsSettingFacede {
Map
<
String
,
Object
>
map
=
SessionUtil
.
getToken4Redis
(
token
);
Long
agentId
=
(
Long
)
map
.
get
(
SessionUtil
.
RAY_AGENT_ID
);
rightsSetting
.
setAgentId
(
agentId
==
null
?
0L
:
agentId
);
Long
userId
=
(
Long
)
map
.
get
(
SessionUtil
.
USER_ID
);
rightsSetting
.
setCreateUserId
(
userId
);
return
new
ResponseDto
<
Long
>(
rightsSettingBiz
.
addRightsSetting
(
rightsSetting
));
}
...
...
@@ -64,7 +66,9 @@ public class RightsSettingFacede {
@PostMapping
(
"updateRightsSetting"
)
public
ResponseDto
<?>
updateRightsSetting
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
@Validated
RightsSetting
rightsSetting
)
throws
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
Map
<
String
,
Object
>
map
=
SessionUtil
.
getToken4Redis
(
token
);
Long
userId
=
(
Long
)
map
.
get
(
SessionUtil
.
USER_ID
);
rightsSetting
.
setUpdateUserId
(
userId
);
rightsSettingBiz
.
updateRightsSetting
(
rightsSetting
);
return
new
ResponseDto
<>();
}
...
...
@@ -87,11 +91,14 @@ public class RightsSettingFacede {
@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
=
"volLabelId"
,
required
=
false
)
Long
volLabelId
,
@RequestParam
(
value
=
"verLabelId"
,
required
=
false
)
Long
verLabelId
@RequestParam
(
value
=
"verLabelId"
,
required
=
false
)
Long
verLabelId
,
@RequestParam
(
value
=
"agentId"
,
required
=
false
)
Long
agentId
)
throws
PermissionException
{
Map
<
String
,
Object
>
map
=
SessionUtil
.
getToken4Redis
(
token
);
Long
agentId
=
(
Long
)
map
.
get
(
SessionUtil
.
RAY_AGENT_ID
);
if
(
null
==
agentId
)
{
agentId
=
(
Long
)
map
.
get
(
SessionUtil
.
RAY_AGENT_ID
);
}
RightsSetting
rightsSetting
=
new
RightsSetting
();
rightsSetting
.
setFirstClassify
(
firstClassify
);
rightsSetting
.
setSecondClassify
(
secondClassify
);
...
...
pcloud-service-book/src/main/resources/mapper/book/Book.Mapper.xml
View file @
451e7d99
...
...
@@ -2461,7 +2461,15 @@
SELECT
A.BOOK_ID, A.CHANNEL_ID, A.ADVISER_ID, A.IS_MAIN_EDITOR, T.TYPE_CODE, T.TYPE_NAME, B.ISBN, B.BOOK_NAME, B.REMARK,
B.AUTHOR, B.PUBLISH, B.PUBLISH_DATE, B.COVER_IMG, B.ORIGIN_NAME, B.BOOK_PRICE, B.ISSN, B.BOOK_NUM, B.SERIAL_NUMBER,
A.TEMPLET_ID,A.SECOND_TEMPLET_ID,A.LAST_MODIFIED_DATE LAST_MODIFIED_DATE,A.BOOK_ADVISER_ID,CONCAT('BK',A.BOOK_ID) uniqueNumber
A.TEMPLET_ID,A.SECOND_TEMPLET_ID,A.LAST_MODIFIED_DATE LAST_MODIFIED_DATE,A.BOOK_ADVISER_ID,CONCAT('BK',A.BOOK_ID) uniqueNumber,
A.GRA_LABEL_ID,
A.SUB_LABEL_ID,
A.VER_LABEL_ID,
A.AREA_LABEL_ID,
A.pro_label_id,
A.dep_label_id,
A.pur_label_id,
A.vol_label_id
FROM
BOOK_ADVISER A
INNER JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID AND A.IS_DELETE = 0 AND B.IS_DELETE = 0
...
...
pcloud-service-book/src/main/resources/mapper/rightssetting/RightsSettingBookRelationMapper.xml
View file @
451e7d99
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.pcloud.book.rightsSetting.mapper.RightsSettingBookRelationMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.rightsSetting.entity.RightsSettingBookRelation"
>
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"rights_setting_id"
property=
"rightsSettingId"
jdbcType=
"BIGINT"
/>
<result
column=
"book_id"
property=
"bookId"
jdbcType=
"BIGINT"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"book_name"
property=
"bookName"
jdbcType=
"VARCHAR"
/>
<result
column=
"adviser_id"
property=
"adviserId"
jdbcType=
"BIGINT"
/>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.rightsSetting.entity.RightsSettingBookRelation"
>
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"rights_setting_id"
property=
"rightsSettingId"
jdbcType=
"BIGINT"
/>
<result
column=
"book_adviser_id"
property=
"bookAdviserId"
jdbcType=
"BIGINT"
/>
<result
column=
"book_id"
property=
"bookId"
jdbcType=
"BIGINT"
/>
<result
column=
"adviser_id"
property=
"adviserId"
jdbcType=
"BIGINT"
/>
<result
column=
"channel_id"
property=
"channelId"
jdbcType=
"BIGINT"
/>
<result
column=
"agent_id"
property=
"agentId"
jdbcType=
"BIGINT"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"book_name"
property=
"bookName"
jdbcType=
"VARCHAR"
/>
<result
column=
"TEMPLET_ID"
property=
"templetId"
jdbcType=
"BIGINT"
/>
<result
column=
"SECOND_TEMPLET_ID"
property=
"secondTempletId"
jdbcType=
"BIGINT"
/>
<result
column=
"GRA_LABEL_ID"
property=
"graLabelId"
jdbcType=
"BIGINT"
/>
<result
column=
"SUB_LABEL_ID"
property=
"subLabelId"
jdbcType=
"BIGINT"
/>
<result
column=
"VER_LABEL_ID"
property=
"verLabelId"
jdbcType=
"BIGINT"
/>
<result
column=
"AREA_LABEL_ID"
property=
"areaLabelId"
jdbcType=
"BIGINT"
/>
<result
column=
"vol_label_id"
property=
"volLabelId"
jdbcType=
"INTEGER"
/>
<result
column=
"group_qrcode_url"
property=
"groupQrcodeUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"COVER_IMG"
property=
"coverImg"
jdbcType=
"VARCHAR"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, rights_setting_id, book_id, create_time, update_time, adviser_id
</sql>
<sql
id=
"Base_Column_List"
>
id, rights_setting_id, book_adviser_id, book_id, adviser_id, channel_id, agent_id, create_time, update_time
</sql>
<sql
id=
"Base_Column_List_owm"
>
r.id, r.rights_setting_id, r.book_id, r.create_time, r.update_time
r.id,
r.rights_setting_id,
r.book_adviser_id,
r.book_id,
r.channel_id,
r.agent_id,
r.create_time,
r.update_time
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Long"
>
select
<include
refid=
"Base_Column_List"
/>
from rights_setting_book_relation
where id = #{id,jdbcType=BIGINT}
</select>
<select
id=
"selectByRithsSettingId"
resultMap=
"BaseResultMap"
>
select
r.id, r.rights_setting_id, r.book_id, r.create_time, r.update_time, ifnull(r.adviser_id, b.adviser_id) adviser_id
<include
refid=
"Base_Column_List_owm"
/>
,b.book_name, b.isbn, ifnull(r.adviser_id,a.adviser_id) adviser_id,
c.group_qrcode_url,
a.TEMPLET_ID,
a.SECOND_TEMPLET_ID,
a.GRA_LABEL_ID,
a.SUB_LABEL_ID,
a.VER_LABEL_ID,
a.AREA_LABEL_ID,
a.vol_label_id,
c.group_qrcode_url,
b.isbn,
b.COVER_IMG
from rights_setting_book_relation r
left join book_adviser b on r.book_id = b.book_id AND b.IS_DELETE=0
where rights_setting_id = #{rightsSettingId,jdbcType=BIGINT}
left join book b on r.book_id = b.book_Id
INNER JOIN book_adviser a ON b.BOOK_ID=a.BOOK_ID AND a.IS_DELETE=0
left join book_group c on a.book_id = c.book_id and a.channel_id = c.channel_id and c.is_delete = 0
where rights_setting_id = #{rightsSettingId}
group by r.book_id
</select>
<select
id=
"getAllBookIds"
resultType=
"java.lang.Long"
>
select book_id
from
rights_setting_book_relation
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
delete from rights_setting_book_relation
where id = #{id,jdbcType=BIGINT}
</delete>
<delete
id=
"deleteByRightsSettingId"
parameterType=
"long"
>
delete from rights_setting_book_relation
where rights_setting_id = #{rightsSettingId,jdbcType=BIGINT}
</delete>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.rightsSetting.entity.RightsSettingBookRelation"
>
insert into rights_setting_book_relation (id, rights_setting_id, book_id,
create_time, update_time)
values (#{id,jdbcType=BIGINT}, #{rightsSettingId,jdbcType=BIGINT}, #{bookId,jdbcType=BIGINT},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.pcloud.book.rightsSetting.entity.RightsSettingBookRelation"
>
insert into rights_setting_book_relation
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
...
...
@@ -86,15 +134,33 @@
</if>
</trim>
</insert>
<insert
id=
"batchInsert"
parameterType=
"com.pcloud.book.rightsSetting.entity.RightsSettingBookRelation"
>
insert into rights_setting_book_relation (rights_setting_id, book_id,
create_time, update_time, adviser_id)
insert into rights_setting_book_relation (
`rights_setting_id`,
`book_adviser_id`,
`book_id`,
`adviser_id`,
`channel_id`,
`agent_id`,
`create_time`,
`update_time`
)
values
<foreach
collection=
"list"
index=
"index"
item=
"item"
separator=
","
>
(#{item.rightsSettingId,jdbcType=BIGINT}, #{item.bookId,jdbcType=BIGINT},
now(),now(), #{item.adviserId})
(#{item.rightsSettingId,jdbcType=BIGINT},
#{item.bookAdviserId,jdbcType=BIGINT},
#{item.bookId,jdbcType=BIGINT},
#{item.adviserId,jdbcType=BIGINT},
#{item.channelId,jdbcType=BIGINT},
#{item.agentId,jdbcType=BIGINT},
now(),
now()
)
</foreach>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.pcloud.book.rightsSetting.entity.RightsSettingBookRelation"
>
update rights_setting_book_relation
<set
>
...
...
@@ -113,6 +179,8 @@
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.pcloud.book.rightsSetting.entity.RightsSettingBookRelation"
>
update rights_setting_book_relation
set rights_setting_id = #{rightsSettingId,jdbcType=BIGINT},
...
...
@@ -121,12 +189,25 @@
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
<select
id=
"selectBookByRithsSettingId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List_owm"
/>
,b.book_name, b.isbn, ifnull(r.adviser_id,a.adviser_id) adviser_id
<include
refid=
"Base_Column_List_owm"
/>
,b.book_name, b.isbn, ifnull(r.adviser_id,a.adviser_id) adviser_id,
c.group_qrcode_url,
a.TEMPLET_ID,
a.SECOND_TEMPLET_ID,
a.GRA_LABEL_ID,
a.SUB_LABEL_ID,
a.VER_LABEL_ID,
a.AREA_LABEL_ID,
a.vol_label_id,
c.group_qrcode_url,
b.isbn,
b.COVER_IMG
from rights_setting_book_relation r
left join book b on r.book_id = b.book_Id
INNER JOIN book_adviser a ON b.BOOK_ID=a.BOOK_ID AND a.IS_DELETE=0
left join book_group c on a.book_id = c.book_id and a.channel_id = c.channel_id and c.is_delete = 0
where rights_setting_id = #{_parameter}
group by r.book_id
</select>
...
...
pcloud-service-book/src/main/resources/mapper/rightssetting/RightsSettingMapper.xml
View file @
451e7d99
...
...
@@ -30,6 +30,8 @@
<result
column=
"show_state"
property=
"showState"
jdbcType=
"BOOLEAN"
/>
<result
column=
"agent_id"
property=
"agentId"
jdbcType=
"BIGINT"
/>
<result
column=
"guide_link_url"
property=
"guideLinkUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"create_user_id"
property=
"createUserId"
jdbcType=
"BIGINT"
/>
<result
column=
"update_user_id"
property=
"updateUserId"
jdbcType=
"BIGINT"
/>
</resultMap>
<resultMap
id=
"DtoResultMap"
type=
"com.pcloud.book.rightsSetting.dto.RightsSettingDto"
>
...
...
@@ -56,6 +58,9 @@
<result
column=
"ver_label_id"
property=
"verLabelId"
jdbcType=
"BIGINT"
/>
<result
column=
"show_state"
property=
"showState"
jdbcType=
"BOOLEAN"
/>
<result
column=
"agent_id"
property=
"agentId"
jdbcType=
"BIGINT"
/>
<result
column=
"create_user_id"
property=
"createUserId"
jdbcType=
"BIGINT"
/>
<result
column=
"update_user_id"
property=
"updateUserId"
jdbcType=
"BIGINT"
/>
<result
column=
"group_qrcode_url"
property=
"groupQrcodeUrl"
jdbcType=
"VARCHAR"
/>
</resultMap>
<resultMap
id=
"DtoResultMap4Book"
type=
"com.pcloud.book.rightsSetting.dto.RightsSettingDto"
extends=
"DtoResultMap"
>
...
...
@@ -67,19 +72,21 @@
id,rights_number, 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
,online_course_open,learning_tool_open,draw_open,read_type_title, vol_label_id,
reading_guide,guide_title,guide_type,guide_id,guide_pic,ver_label_id, show_state, agent_id, guide_link_url
reading_guide,guide_title,guide_type,guide_id,guide_pic,ver_label_id, show_state, agent_id, guide_link_url,
create_user_id, update_user_id
</sql>
<sql
id=
"Base_Column_List_own"
>
r.id,r.rights_number, 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.online_course_open,r.learning_tool_open,r.draw_open,r.read_type_title,r.vol_label_id,r.ver_label_id, r.show_state
,r.online_course_open,r.learning_tool_open,r.draw_open,r.read_type_title,r.vol_label_id,r.ver_label_id, r.show_state,
r.update_user_id, r.update_user_id
</sql>
<sql
id=
"Base_Column_List_1"
>
r.id,r.rights_number, 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, b.book_id
,r.online_course_open,r.learning_tool_open,r.draw_open,r.read_type_title,r.vol_label_id,r.ver_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
, r.update_user_id, r.update_user_id
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Long"
>
...
...
@@ -98,13 +105,13 @@
grade_label_id, subject_label_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,
reading_guide,guide_title,guide_type,guide_id,guide_pic,ver_label_id, agent_id, guide_link_url)
reading_guide,guide_title,guide_type,guide_id,guide_pic,ver_label_id, agent_id, guide_link_url
,create_user_id
)
values ( #{rightsNumber,jdbcType=VARCHAR}, #{introduce,jdbcType=VARCHAR}, #{detail,jdbcType=VARCHAR},
#{count,jdbcType=INTEGER}, #{firstClassify,jdbcType=BIGINT}, #{secondClassify,jdbcType=BIGINT},
#{gradeLabelId,jdbcType=BIGINT}, #{subjectLabelId,jdbcType=BIGINT}, now(),
#{updateTime,jdbcType=TIMESTAMP}
, #{enableGroupService}, #{rightsSettingType}, #{bookId},
now()
, #{enableGroupService}, #{rightsSettingType}, #{bookId},
#{onlineCourseOpen},#{learningToolOpen},#{drawNowOpen},#{readTypeTitle}, #{volLabelId},
#{guideIsOpen},#{guideTitle},#{guideType},#{guideId},#{guidePic}, #{verLabelId}, #{agentId}, #{guideLinkUrl})
#{guideIsOpen},#{guideTitle},#{guideType},#{guideId},#{guidePic}, #{verLabelId}, #{agentId}, #{guideLinkUrl}
, #{createUserId}
)
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.pcloud.book.rightsSetting.entity.RightsSetting"
>
update rights_setting
...
...
@@ -199,7 +206,7 @@
second_classify = #{secondClassify,jdbcType=BIGINT},
grade_label_id = #{gradeLabelId,jdbcType=BIGINT},
subject_label_id = #{subjectLabelId,jdbcType=BIGINT},
update_time =
#{updateTime,jdbcType=TIMESTAMP}
,
update_time =
now()
,
enable_group_service = #{enableGroupService},
book_id = #{bookId},
online_course_open = #{onlineCourseOpen},
...
...
@@ -213,7 +220,8 @@
guide_id = #{guideId,jdbcType=BIGINT},
guide_pic = #{guidePic,jdbcType=VARCHAR},
ver_label_id = #{verLabelId,jdbcType=BIGINT},
guide_link_url = #{guideLinkUrl}
guide_link_url = #{guideLinkUrl},
update_user_id = #{updateUserId}
where id = #{id,jdbcType=BIGINT}
</update>
...
...
@@ -264,7 +272,9 @@
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, r.show_state,
b.isbn,
ifnull(s.adviser_id,a.adviser_id) adviser_id
ifnull(s.adviser_id,a.adviser_id) adviser_id,
r.create_user_id,
r.update_user_id
from
rights_setting r
left join rights_setting_book_relation s on r.id = s.rights_setting_id
...
...
@@ -281,6 +291,24 @@
${item}
</foreach>
</if>
<if
test=
"firstClassify != null"
>
and a.TEMPLET_ID = #{firstClassify}
</if>
<if
test=
"secondClassify != null"
>
and a.SECOND_TEMPLET_ID = #{secondClassify}
</if>
<if
test=
"gradeLabelId != null"
>
and a.GRA_LABEL_ID = #{gradeLabelId}
</if>
<if
test=
"subjectLabelId != null"
>
and a.SUB_LABEL_ID = #{subjectLabelId}
</if>
<if
test=
"volLabelId != null"
>
and a.vol_label_id = #{volLabelId}
</if>
<if
test=
"verLabelId != null"
>
and a.VER_LABEL_ID = #{verLabelId}
</if>
group by r.id
order by r.create_time desc
</select>
...
...
@@ -370,4 +398,13 @@
</foreach>
</update>
<update
id=
"updateUser"
parameterType=
"com.pcloud.book.rightsSetting.entity.RightsSetting"
>
update
rights_setting
set
update_time = now(),
update_user_id = #{updateUserId}
where id = #{id,jdbcType=BIGINT}
</update>
</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