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
f9389f97
Commit
f9389f97
authored
Apr 13, 2020
by
吴博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1002712
parent
60879852
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
861 additions
and
11 deletions
+861
-11
BookAdviserDto.java
...rc/main/java/com/pcloud/book/book/dto/BookAdviserDto.java
+69
-0
BookRightsSettingDTO.java
...n/java/com/pcloud/book/book/dto/BookRightsSettingDTO.java
+24
-0
BookAdviserService.java
...java/com/pcloud/book/book/service/BookAdviserService.java
+6
-0
BookGroupService.java
.../java/com/pcloud/book/group/service/BookGroupService.java
+4
-0
AdvertisingSpaceServiceImpl.java
...advertising/service/impl/AdvertisingSpaceServiceImpl.java
+5
-0
BookAdviserBiz.java
...rc/main/java/com/pcloud/book/book/biz/BookAdviserBiz.java
+9
-0
BookAdviserBizImpl.java
...ava/com/pcloud/book/book/biz/impl/BookAdviserBizImpl.java
+22
-0
BookAdviserServiceImpl.java
...pcloud/book/book/service/impl/BookAdviserServiceImpl.java
+9
-0
AssistTempletConsr.java
...java/com/pcloud/book/consumer/app/AssistTempletConsr.java
+26
-0
BookGroupBizImpl.java
...java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
+16
-1
BookAppletSceneDTO.java
...in/java/com/pcloud/book/group/dto/BookAppletSceneDTO.java
+13
-0
PushBookGroupUpdateRunner.java
.../pcloud/book/group/handler/PushBookGroupUpdateRunner.java
+3
-0
BookGroupServiceImpl.java
.../pcloud/book/group/service/impl/BookGroupServiceImpl.java
+16
-0
RightsSettingBiz.java
...a/com/pcloud/book/rightsSetting/biz/RightsSettingBiz.java
+22
-0
RightsSettingBizImpl.java
...oud/book/rightsSetting/biz/impl/RightsSettingBizImpl.java
+214
-0
RightsSettingConstant.java
...d/book/rightsSetting/constants/RightsSettingConstant.java
+17
-0
RightsSettingDAO.java
...a/com/pcloud/book/rightsSetting/dao/RightsSettingDAO.java
+17
-0
RightsSettingMapper.java
...om/pcloud/book/rightsSetting/dao/RightsSettingMapper.java
+18
-0
RightsSettingCheck.java
...loud/book/rightsSetting/dao/check/RightsSettingCheck.java
+31
-0
RightsSettingDAOImpl.java
...oud/book/rightsSetting/dao/impl/RightsSettingDAOImpl.java
+43
-0
RightsSettingDto.java
...a/com/pcloud/book/rightsSetting/dto/RightsSettingDto.java
+15
-0
RightsSetting.java
...a/com/pcloud/book/rightsSetting/entity/RightsSetting.java
+25
-0
RightsSettingFacede.java
...pcloud/book/rightsSetting/facade/RightsSettingFacede.java
+76
-0
generatorConfig.xml
pcloud-service-book/src/main/resources/generatorConfig.xml
+8
-8
BookAdviser.Mapper.xml
...ook/src/main/resources/mapper/book/BookAdviser.Mapper.xml
+7
-1
BookGroupMapper.xml
...-book/src/main/resources/mapper/group/BookGroupMapper.xml
+3
-1
RightsSettingMapper.xml
...in/resources/mapper/rightssetting/RightsSettingMapper.xml
+143
-0
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/book/dto/BookAdviserDto.java
View file @
f9389f97
...
...
@@ -87,6 +87,29 @@ public class BookAdviserDto extends BaseDto {
* 是否已经被删除 1是 0否
*/
private
Integer
isDelete
;
/**
* 第二级类型
*/
private
Long
secondTempletId
;
/**
* 年级标签id
*/
private
Long
graLabelId
;
/**
* 科目标签id
*/
private
Long
subLabelId
;
/**
* 版本标签id
*/
private
Long
verLabelId
;
/**
* 地域标签id
*/
private
Long
areaLabelId
;
public
Integer
getCount
()
{
return
count
;
...
...
@@ -216,6 +239,46 @@ public class BookAdviserDto extends BaseDto {
this
.
templetId
=
templetId
;
}
public
Long
getSecondTempletId
()
{
return
secondTempletId
;
}
public
void
setSecondTempletId
(
Long
secondTempletId
)
{
this
.
secondTempletId
=
secondTempletId
;
}
public
Long
getGraLabelId
()
{
return
graLabelId
;
}
public
void
setGraLabelId
(
Long
graLabelId
)
{
this
.
graLabelId
=
graLabelId
;
}
public
Long
getSubLabelId
()
{
return
subLabelId
;
}
public
void
setSubLabelId
(
Long
subLabelId
)
{
this
.
subLabelId
=
subLabelId
;
}
public
Long
getVerLabelId
()
{
return
verLabelId
;
}
public
void
setVerLabelId
(
Long
verLabelId
)
{
this
.
verLabelId
=
verLabelId
;
}
public
Long
getAreaLabelId
()
{
return
areaLabelId
;
}
public
void
setAreaLabelId
(
Long
areaLabelId
)
{
this
.
areaLabelId
=
areaLabelId
;
}
@Override
public
String
toString
()
{
return
"BookAdviserDto{"
+
...
...
@@ -226,6 +289,7 @@ public class BookAdviserDto extends BaseDto {
", adviserId="
+
adviserId
+
", adviserName='"
+
adviserName
+
'\''
+
", channelId="
+
channelId
+
", templetId="
+
templetId
+
", channelName='"
+
channelName
+
'\''
+
", count="
+
count
+
", isMainEditor="
+
isMainEditor
+
...
...
@@ -233,6 +297,11 @@ public class BookAdviserDto extends BaseDto {
", agentName='"
+
agentName
+
'\''
+
", bookDto="
+
bookDto
+
", isDelete="
+
isDelete
+
", secondTempletId="
+
secondTempletId
+
", graLabelId="
+
graLabelId
+
", subLabelId="
+
subLabelId
+
", verLabelId="
+
verLabelId
+
", areaLabelId="
+
areaLabelId
+
'}'
;
}
}
pcloud-facade-book/src/main/java/com/pcloud/book/book/dto/BookRightsSettingDTO.java
0 → 100644
View file @
f9389f97
package
com
.
pcloud
.
book
.
book
.
dto
;
import
com.pcloud.common.dto.BaseDto
;
import
lombok.Data
;
/**
* 书刊小睿品牌介绍页权益
*/
@Data
public
class
BookRightsSettingDTO
extends
BaseDto
{
/**
* 权益介绍
*/
private
String
rightsSettingIntroduce
;
/**
*权益详情
*/
private
String
rightsSettingDetail
;
/**
*权益数量
*/
private
Integer
rightsSettingCount
;
}
pcloud-facade-book/src/main/java/com/pcloud/book/book/service/BookAdviserService.java
View file @
f9389f97
...
...
@@ -126,4 +126,10 @@ public interface BookAdviserService {
ResponseEntity
<
ResponseDto
<
String
>>
refactorData
(
@RequestParam
(
"parentId"
)
Long
parentId
,
@RequestParam
(
"originTempletId"
)
Long
originTempletId
,
@RequestParam
(
value
=
"secondTempletId"
,
required
=
false
)
Long
secondTempletId
)
throws
BizException
;
@ApiOperation
(
"获取书刊小睿品牌介绍页权益"
)
@GetMapping
(
"getBookRightsSetting"
)
ResponseEntity
<
ResponseDto
<
BookRightsSettingDTO
>>
getBookRightsSetting
(
@RequestParam
(
"bookId"
)
Long
bookId
,
@RequestParam
(
"channelId"
)
Long
channelId
,
@RequestParam
(
"adviserId"
)
Long
adviserId
);
}
pcloud-facade-book/src/main/java/com/pcloud/book/group/service/BookGroupService.java
View file @
f9389f97
...
...
@@ -211,4 +211,8 @@ public interface BookGroupService {
@ApiOperation
(
"根据用户和社群书id获取个人号信息"
)
@GetMapping
(
"getSelfRobotBookGroupInfoByUser"
)
ResponseEntity
<
ResponseDto
<
SelfRobotBookGroupDTO
>>
getSelfRobotBookGroupInfoByUser
(
@RequestParam
(
"wxUserId"
)
String
wxUserId
,
@RequestParam
(
"bookGroupId"
)
Long
bookGroupId
);
@ApiOperation
(
"每天增加小程序权益读者数量"
)
@GetMapping
(
"addUserCount4RightsSetting"
)
void
addUserCount4RightsSetting
();
}
pcloud-service-book/src/main/java/com/pcloud/book/advertising/service/impl/AdvertisingSpaceServiceImpl.java
View file @
f9389f97
...
...
@@ -4,6 +4,7 @@ import com.pcloud.book.advertising.biz.AdvertisingSpaceBiz;
import
com.pcloud.book.advertising.biz.GroupTagBiz
;
import
com.pcloud.book.advertising.biz.LinkRevertBiz
;
import
com.pcloud.book.advertising.service.AdvertisingSpaceService
;
import
com.pcloud.book.group.service.BookGroupService
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.exceptions.BizException
;
...
...
@@ -42,6 +43,8 @@ public class AdvertisingSpaceServiceImpl implements AdvertisingSpaceService {
private
GroupTagBiz
groupTagBiz
;
@Autowired
private
LinkRevertBiz
linkRevertBiz
;
@Autowired
private
BookGroupService
bookGroupService
;
/**
* 每日凌晨计算昨日广告位收益
...
...
@@ -52,6 +55,8 @@ public class AdvertisingSpaceServiceImpl implements AdvertisingSpaceService {
advertisingSpaceBiz
.
calculateAdvertisingIncomeYesterday
();
//统计昨日链接发送次数
linkRevertBiz
.
addYesterdaySendStatistic
();
//新增读者数量
bookGroupService
.
addUserCount4RightsSetting
();
}
@ApiOperation
(
"发送广告计划"
)
...
...
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/BookAdviserBiz.java
View file @
f9389f97
...
...
@@ -196,4 +196,13 @@ public interface BookAdviserBiz {
* @throws BizException
*/
void
setIsPrint
(
BookAdviser
bookAdviser
)
throws
BizException
;
/**
* 获取书刊小睿品牌介绍页权益
* @param bookId
* @param channelId
* @param adviserId
* @return
*/
BookRightsSettingDTO
getBookRightsSetting
(
Long
bookId
,
Long
channelId
,
Long
adviserId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookAdviserBizImpl.java
View file @
f9389f97
...
...
@@ -7,6 +7,10 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
com.pcloud.book.book.dto.BookRightsSettingDTO
;
import
com.pcloud.book.rightsSetting.biz.RightsSettingBiz
;
import
com.pcloud.book.rightsSetting.dto.RightsSettingDto
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -104,6 +108,8 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
@Autowired
private
BookGroupDao
bookGroupDao
;
@Autowired
private
RightsSettingBiz
rightsSettingBiz
;
@Override
public
List
<
BookDto
>
listByAdviserId
(
Long
adviserId
)
{
...
...
@@ -810,4 +816,20 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
}
bookAdviserDao
.
setIsPrint
(
bookAdviser
);
}
@Override
public
BookRightsSettingDTO
getBookRightsSetting
(
Long
bookId
,
Long
channelId
,
Long
adviserId
)
{
BookRightsSettingDTO
bookRightsSettingDTO
=
new
BookRightsSettingDTO
();
BookAdviserDto
adviserDto
=
bookAdviserDao
.
getBase
(
bookId
,
channelId
,
adviserId
);
if
(
null
!=
adviserDto
){
RightsSettingDto
rightsSettingDto
=
rightsSettingBiz
.
getByLabel
(
adviserDto
.
getTempletId
(),
adviserDto
.
getSecondTempletId
(),
adviserDto
.
getGraLabelId
(),
adviserDto
.
getSubLabelId
());
if
(
null
!=
rightsSettingDto
){
bookRightsSettingDTO
.
setRightsSettingDetail
(
rightsSettingDto
.
getDetail
());
bookRightsSettingDTO
.
setRightsSettingIntroduce
(
rightsSettingDto
.
getIntroduce
());
bookRightsSettingDTO
.
setRightsSettingCount
(
rightsSettingDto
.
getCount
());
}
}
return
bookRightsSettingDTO
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/book/service/impl/BookAdviserServiceImpl.java
View file @
f9389f97
...
...
@@ -124,4 +124,13 @@ public class BookAdviserServiceImpl implements BookAdviserService {
bookAdviserBiz
.
refactorData
(
parentId
,
originTempletId
,
secondTempletId
);
return
ResponseHandleUtil
.
toResponse
(
"ok"
);
}
@Override
@GetMapping
(
"getBookRightsSetting"
)
public
ResponseEntity
<
ResponseDto
<
BookRightsSettingDTO
>>
getBookRightsSetting
(
@RequestParam
(
"bookId"
)
Long
bookId
,
@RequestParam
(
"channelId"
)
Long
channelId
,
@RequestParam
(
"adviserId"
)
Long
adviserId
)
{
BookRightsSettingDTO
bookRightsSettingDTO
=
bookAdviserBiz
.
getBookRightsSetting
(
bookId
,
channelId
,
adviserId
);
return
ResponseHandleUtil
.
toResponse
(
bookRightsSettingDTO
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/consumer/app/AssistTempletConsr.java
View file @
f9389f97
...
...
@@ -71,4 +71,30 @@ public class AssistTempletConsr {
}
return
ids
;
}
/**
* 获取模板基本信息
*
* @return
*/
public
Map
<
Long
,
AssistTempletDTO
>
mapByIds4Classify
(
List
<
Long
>
assistTempletIds
)
{
LOGGER
.
info
(
"获取模板基本信息[assistTempletService.mapByIds4Classify],参数列表[assistTempletIds]:"
+
assistTempletIds
);
Map
<
Long
,
AssistTempletDTO
>
assistTempletDTOs
=
new
HashMap
<>();
if
(
ListUtils
.
isEmpty
(
assistTempletIds
))
{
return
assistTempletDTOs
;
}
try
{
assistTempletDTOs
=
ResponseHandleUtil
.
parseMapResponse
(
assistTempletService
.
mapByIds4Classify
(
assistTempletIds
),
Long
.
class
,
AssistTempletDTO
.
class
);
}
catch
(
BizException
e
)
{
LOGGER
.
warn
(
"获取模板基本信息[assistTempletService.mapByIds4Classify]:"
+
e
.
getMessage
(),
e
);
throw
new
BizException
(
e
.
getCode
(),
e
.
getMessage
());
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"获取模板基本信息[assistTempletService.mapByIds4Classify]:"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_APP_ERROR
,
"获取模板基本信息失败~!"
);
}
return
assistTempletDTOs
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
View file @
f9389f97
...
...
@@ -77,6 +77,8 @@ import com.pcloud.book.pcloudkeyword.biz.PcloudRobotBiz;
import
com.pcloud.book.pcloudkeyword.entity.PcloudRobot
;
import
com.pcloud.book.push.enums.AltTypeEnum
;
import
com.pcloud.book.reading.dao.ReadingUserDao
;
import
com.pcloud.book.rightsSetting.biz.RightsSettingBiz
;
import
com.pcloud.book.rightsSetting.dto.RightsSettingDto
;
import
com.pcloud.book.util.common.ThreadPoolUtils
;
import
com.pcloud.channelcenter.base.constants.ChannelConstants
;
import
com.pcloud.channelcenter.qrcode.dto.GroupQrcodeVO
;
...
...
@@ -299,6 +301,8 @@ public class BookGroupBizImpl implements BookGroupBiz {
private
WechatConsr
wechatConsr
;
@Autowired
private
BookAppletSceneDao
bookAppletSceneDao
;
@Autowired
private
RightsSettingBiz
rightsSettingBiz
;
private
static
final
ThreadPoolExecutor
PLATFORM_STATISTICS_EXPORT_THREAD
=
new
ThreadPoolExecutor
(
2
,
2
,
0
,
TimeUnit
.
SECONDS
,
new
LinkedBlockingQueue
<>(),
...
...
@@ -4441,8 +4445,19 @@ public class BookGroupBizImpl implements BookGroupBiz {
if
(
null
!=
bookAppletScene
){
BeanUtils
.
copyProperties
(
bookAppletScene
,
dto
);
}
BookGroupDTO
bookGroupDTO
=
bookGroupDao
.
getBookBaseInfoById
(
bookGroupId
);
BookGroupDTO
bookGroupDTO
=
bookGroupDao
.
getBookBaseInfoById
(
bookGroupId
);
dto
.
setBookName
(
StringUtil
.
addBracket
(
bookGroupDTO
.
getBookName
()));
//权益
BookAdviserDto
adviserDto
=
bookAdviserDao
.
getBase
(
bookGroupDTO
.
getBookId
(),
bookGroupDTO
.
getChannelId
(),
bookGroupDTO
.
getCreateUser
());
if
(
null
!=
adviserDto
){
RightsSettingDto
rightsSettingDto
=
rightsSettingBiz
.
getByLabel
(
adviserDto
.
getTempletId
(),
adviserDto
.
getSecondTempletId
(),
adviserDto
.
getGraLabelId
(),
adviserDto
.
getSubLabelId
());
if
(
null
!=
rightsSettingDto
){
dto
.
setRightsSettingDetail
(
rightsSettingDto
.
getDetail
());
dto
.
setRightsSettingIntroduce
(
rightsSettingDto
.
getIntroduce
());
dto
.
setRightsSettingCount
(
rightsSettingDto
.
getCount
());
}
}
return
dto
;
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/dto/BookAppletSceneDTO.java
View file @
f9389f97
...
...
@@ -36,5 +36,18 @@ public class BookAppletSceneDTO extends BaseDto {
* 书名
*/
private
String
bookName
;
/**
* 权益介绍
*/
private
String
rightsSettingIntroduce
;
/**
*权益详情
*/
private
String
rightsSettingDetail
;
/**
*权益数量
*/
private
Integer
rightsSettingCount
;
}
pcloud-service-book/src/main/java/com/pcloud/book/group/handler/PushBookGroupUpdateRunner.java
View file @
f9389f97
...
...
@@ -3,11 +3,14 @@ package com.pcloud.book.group.handler;
import
com.pcloud.book.group.biz.BookGroupBiz
;
import
com.pcloud.common.utils.DateUtils
;
import
com.pcloud.common.utils.cache.redis.JedisClusterUtils
;
import
com.pcloud.common.utils.string.StringUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.ApplicationArguments
;
import
org.springframework.boot.ApplicationRunner
;
import
org.springframework.stereotype.Component
;
import
java.util.Date
;
import
java.util.Random
;
import
lombok.extern.slf4j.Slf4j
;
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/service/impl/BookGroupServiceImpl.java
View file @
f9389f97
...
...
@@ -22,9 +22,12 @@ import com.pcloud.common.dto.ResponseDto;
import
com.pcloud.common.dto.StoreFlowInfoDto
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.utils.DateUtils
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.ResponseHandleUtil
;
import
com.pcloud.common.utils.cache.redis.JedisClusterUtils
;
import
com.pcloud.common.utils.string.StringUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -36,8 +39,10 @@ import org.springframework.web.bind.annotation.RequestParam;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Random
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
...
...
@@ -359,4 +364,15 @@ public class BookGroupServiceImpl implements BookGroupService {
SelfRobotBookGroupDTO
selfRobotBookGroupDTO
=
bookGroupBiz
.
getSelfRobotBookGroupInfoByUser
(
wxUserId
,
bookGroupId
);
return
ResponseHandleUtil
.
toResponse
(
selfRobotBookGroupDTO
);
}
@Override
public
void
addUserCount4RightsSetting
()
{
//每天增加读者数
String
key
=
"BOOK:APPLET:RIGHTS_SETTING_USER_COUNT"
;
String
value
=
JedisClusterUtils
.
get
(
key
);
if
(!
StringUtil
.
isEmpty
(
value
)){
Integer
count
=
Integer
.
valueOf
(
value
)+
new
Random
().
nextInt
(
10
)+
20
;
JedisClusterUtils
.
set
(
key
,
count
.
toString
(),
36
*
3600
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/biz/RightsSettingBiz.java
0 → 100644
View file @
f9389f97
package
com
.
pcloud
.
book
.
rightsSetting
.
biz
;
import
com.pcloud.book.rightsSetting.dto.RightsSettingDto
;
import
com.pcloud.book.rightsSetting.entity.RightsSetting
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.page.PageBeanNew
;
public
interface
RightsSettingBiz
{
Long
addRightsSetting
(
RightsSetting
rightsSetting
);
void
deleteRightsSetting
(
Long
id
);
void
updateRightsSetting
(
RightsSetting
rightsSetting
);
RightsSetting
getRightsSetting
(
Long
id
);
PageBeanNew
<
RightsSettingDto
>
listRightsSettingPage
(
Integer
currentPage
,
Integer
numPerPage
,
RightsSetting
rightsSetting
);
RightsSettingDto
getByLabel
(
Long
firstClassify
,
Long
secondClassify
,
Long
gradeLabelId
,
Long
subjectLabelId
);
Integer
getUserCount
();
}
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/biz/impl/RightsSettingBizImpl.java
0 → 100644
View file @
f9389f97
package
com
.
pcloud
.
book
.
rightsSetting
.
biz
.
impl
;
import
com.pcloud.appcenter.assist.dto.AssistTempletDTO
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.book.biz.BookBiz
;
import
com.pcloud.book.book.dao.BookLabelDao
;
import
com.pcloud.book.book.entity.BookLabel
;
import
com.pcloud.book.consumer.app.AssistTempletConsr
;
import
com.pcloud.book.rightsSetting.biz.RightsSettingBiz
;
import
com.pcloud.book.rightsSetting.constants.RightsSettingConstant
;
import
com.pcloud.book.rightsSetting.dao.RightsSettingDAO
;
import
com.pcloud.book.rightsSetting.dao.check.RightsSettingCheck
;
import
com.pcloud.book.rightsSetting.dto.RightsSettingDto
;
import
com.pcloud.book.rightsSetting.entity.RightsSetting
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.cache.redis.JedisClusterUtils
;
import
com.pcloud.common.utils.string.StringUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.MapUtils
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@Service
@Slf4j
public
class
RightsSettingBizImpl
implements
RightsSettingBiz
{
@Autowired
private
RightsSettingDAO
rightsSettingDAO
;
@Autowired
private
RightsSettingCheck
rightsSettingCheck
;
@Autowired
private
BookLabelDao
bookLabelDao
;
@Autowired
private
AssistTempletConsr
assistTempletConsr
;
@Value
(
"${system.env}"
)
private
String
envStr
;
@Override
@ParamLog
(
"新增权益设置"
)
public
Long
addRightsSetting
(
RightsSetting
rightsSetting
)
{
rightsSettingCheck
.
rightsSettingCheck
(
rightsSetting
);
setClassifyAndLabel
(
rightsSetting
);
RightsSettingDto
rightsSettingDto
=
getByLabel
(
rightsSetting
.
getFirstClassify
(),
rightsSetting
.
getSecondClassify
(),
rightsSetting
.
getGradeLabelId
(),
rightsSetting
.
getSubjectLabelId
());
if
(
null
!=
rightsSettingDto
){
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"已存在相同的权益设置"
);
}
return
rightsSettingDAO
.
insert
(
rightsSetting
);
}
private
void
setClassifyAndLabel
(
RightsSetting
rightsSetting
)
{
log
.
info
(
"对于某些特殊分类做处理"
);
Boolean
contain4K12
=
false
;
Boolean
contain4Medical
=
false
;
if
(
"test"
.
equals
(
envStr
)
&&
ArrayUtils
.
contains
(
RightsSettingConstant
.
K12_TEMPLET_ID_TEST
,
rightsSetting
.
getFirstClassify
())){
contain4K12
=
true
;
}
else
if
(!
"test"
.
equals
(
envStr
)
&&
ArrayUtils
.
contains
(
RightsSettingConstant
.
K12_TEMPLET_ID
,
rightsSetting
.
getFirstClassify
())){
contain4K12
=
true
;
}
if
(!
ArrayUtils
.
contains
(
RightsSettingConstant
.
MEDICAL_INSURANCE_TEMPLET_ID
,
rightsSetting
.
getFirstClassify
())){
rightsSetting
.
setSecondClassify
(
null
);
}
if
(!
contain4K12
){
rightsSetting
.
setGradeLabelId
(
null
);
rightsSetting
.
setSubjectLabelId
(
null
);
}
}
@Override
@ParamLog
(
"删除权益设置"
)
public
void
deleteRightsSetting
(
Long
id
)
{
rightsSettingDAO
.
deleteByPrimaryKey
(
id
);
}
@Override
@ParamLog
(
"更新权益设置"
)
public
void
updateRightsSetting
(
RightsSetting
rightsSetting
)
{
rightsSettingCheck
.
rightsSettingCheck
(
rightsSetting
);
setClassifyAndLabel
(
rightsSetting
);
RightsSettingDto
rightsSettingDto
=
getByLabel
(
rightsSetting
.
getFirstClassify
(),
rightsSetting
.
getSecondClassify
(),
rightsSetting
.
getGradeLabelId
(),
rightsSetting
.
getSubjectLabelId
());
if
(
null
!=
rightsSettingDto
&&
!
rightsSettingDto
.
getId
().
equals
(
rightsSetting
.
getId
())){
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"已存在相同的权益设置"
);
}
rightsSetting
.
setUpdateTime
(
new
Date
());
rightsSettingDAO
.
updateByPrimaryKeySelective
(
rightsSetting
);
}
@Override
@ParamLog
(
"获取权益设置"
)
public
RightsSetting
getRightsSetting
(
Long
id
)
{
return
rightsSettingDAO
.
selectByPrimaryKey
(
id
);
}
@Override
@ParamLog
(
value
=
"获取权益分类分页列表"
,
isAfterReturn
=
false
)
public
PageBeanNew
<
RightsSettingDto
>
listRightsSettingPage
(
Integer
currentPage
,
Integer
numPerPage
,
RightsSetting
rightsSetting
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
if
(
null
!=
rightsSetting
.
getFirstClassify
()){
setClassifyAndLabel
(
rightsSetting
);
}
paramMap
.
put
(
"firstClassify"
,
rightsSetting
.
getFirstClassify
());
paramMap
.
put
(
"secondClassify"
,
rightsSetting
.
getSecondClassify
());
paramMap
.
put
(
"gradeLabelId"
,
rightsSetting
.
getGradeLabelId
());
paramMap
.
put
(
"subjectLabelId"
,
rightsSetting
.
getSubjectLabelId
());
PageBeanNew
<
RightsSettingDto
>
rightsSettingDtoPageBeanNew
=
rightsSettingDAO
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
paramMap
,
"listRightsSettingPage"
);
if
(
null
!=
rightsSettingDtoPageBeanNew
&&
!
ListUtils
.
isEmpty
(
rightsSettingDtoPageBeanNew
.
getRecordList
())){
List
<
RightsSettingDto
>
rightsSettingDtos
=
rightsSettingDtoPageBeanNew
.
getRecordList
();
setLabelContent
(
rightsSettingDtos
);
}
return
rightsSettingDtoPageBeanNew
;
}
private
void
setLabelContent
(
List
<
RightsSettingDto
>
rightsSettingDtos
)
{
log
.
info
(
"权益设置标签具体内容"
);
if
(
ListUtils
.
isEmpty
(
rightsSettingDtos
)){
return
;
}
List
<
Long
>
firstClassifyIds
=
new
ArrayList
<>();
List
<
Long
>
secondClassifyIds
=
new
ArrayList
<>();
List
<
Long
>
classifyIds
=
new
ArrayList
<>();
List
<
Long
>
gradeLabelIds
=
new
ArrayList
<>();
List
<
Long
>
subjectLabelIds
=
new
ArrayList
<>();
List
<
Long
>
labelIds
=
new
ArrayList
<>();
firstClassifyIds
=
rightsSettingDtos
.
stream
().
map
(
e
->
e
.
getFirstClassify
()).
collect
(
Collectors
.
toList
());
secondClassifyIds
=
rightsSettingDtos
.
stream
().
map
(
e
->
e
.
getSecondClassify
()).
collect
(
Collectors
.
toList
());
gradeLabelIds
=
rightsSettingDtos
.
stream
().
map
(
e
->
e
.
getGradeLabelId
()).
collect
(
Collectors
.
toList
());
subjectLabelIds
=
rightsSettingDtos
.
stream
().
map
(
e
->
e
.
getSubjectLabelId
()).
collect
(
Collectors
.
toList
());
if
(!
ListUtils
.
isEmpty
(
firstClassifyIds
)){
classifyIds
.
addAll
(
firstClassifyIds
);
}
if
(!
ListUtils
.
isEmpty
(
secondClassifyIds
)){
classifyIds
.
addAll
(
secondClassifyIds
);
}
if
(!
ListUtils
.
isEmpty
(
gradeLabelIds
)){
labelIds
.
addAll
(
gradeLabelIds
);
}
if
(!
ListUtils
.
isEmpty
(
subjectLabelIds
)){
labelIds
.
addAll
(
subjectLabelIds
);
}
Map
<
Long
,
AssistTempletDTO
>
classifyMap
=
new
HashMap
<>();
Map
<
Long
,
BookLabel
>
labelMap
=
new
HashMap
<>();
if
(!
ListUtils
.
isEmpty
(
classifyIds
)){
classifyMap
=
assistTempletConsr
.
mapByIds4Classify
(
classifyIds
);
}
if
(!
ListUtils
.
isEmpty
(
labelIds
)){
labelMap
=
bookLabelDao
.
getMapByIds
(
labelIds
);
}
for
(
RightsSettingDto
rightsSettingDto
:
rightsSettingDtos
){
if
(!
MapUtils
.
isEmpty
(
classifyMap
)
&&
classifyMap
.
containsKey
(
rightsSettingDto
.
getFirstClassify
())){
rightsSettingDto
.
setFirstClassifyContent
(
classifyMap
.
get
(
rightsSettingDto
.
getFirstClassify
()).
getTempletName
());
}
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
(
labelMap
)
&&
labelMap
.
containsKey
(
rightsSettingDto
.
getSubjectLabelId
())){
rightsSettingDto
.
setSubjectLabelIdContent
(
labelMap
.
get
(
rightsSettingDto
.
getSubjectLabelId
()).
getName
());
}
}
}
@Override
public
RightsSettingDto
getByLabel
(
Long
firstClassify
,
Long
secondClassify
,
Long
gradeLabelId
,
Long
subjectLabelId
)
{
//医疗保健分类校验
if
(
ArrayUtils
.
contains
(
RightsSettingConstant
.
MEDICAL_INSURANCE_TEMPLET_ID
,
firstClassify
)){
subjectLabelId
=
null
;
gradeLabelId
=
null
;
}
//k12教育分类校验
else
if
(
"test"
.
equals
(
envStr
)
&&
ArrayUtils
.
contains
(
RightsSettingConstant
.
K12_TEMPLET_ID_TEST
,
firstClassify
)){
secondClassify
=
null
;
}
else
if
(!
"test"
.
equals
(
envStr
)
&&
ArrayUtils
.
contains
(
RightsSettingConstant
.
K12_TEMPLET_ID
,
firstClassify
)){
secondClassify
=
null
;
}
else
{
secondClassify
=
null
;
subjectLabelId
=
null
;
gradeLabelId
=
null
;
}
RightsSettingDto
dto
=
rightsSettingDAO
.
getByLabel
(
firstClassify
,
secondClassify
,
gradeLabelId
,
subjectLabelId
);
return
dto
;
}
@Override
public
Integer
getUserCount
()
{
Integer
userCount
=
102336
;
String
key
=
"BOOK:APPLET:RIGHTS_SETTING_USER_COUNT"
;
String
value
=
JedisClusterUtils
.
get
(
key
);
if
(
StringUtil
.
isEmpty
(
value
)){
JedisClusterUtils
.
set
(
key
,
userCount
.
toString
(),
24
*
3600
);
}
else
{
userCount
=
Integer
.
valueOf
(
value
);
}
return
userCount
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/constants/RightsSettingConstant.java
0 → 100644
View file @
f9389f97
package
com
.
pcloud
.
book
.
rightsSetting
.
constants
;
public
class
RightsSettingConstant
{
/**
* 所属k12教育的编辑书刊分类id--生产uat
*/
public
static
final
Long
[]
K12_TEMPLET_ID
=
{
48L
,
59L
,
46L
,
40L
,
65L
,
60L
,
131L
};
/**
* 所属k12教育的编辑书刊分类id--测试环境
*/
public
static
final
Long
[]
K12_TEMPLET_ID_TEST
=
{
48L
,
59L
,
46L
,
40L
,
65L
,
60L
,
136L
};
/**
* 医疗保健编辑书刊分类id
*/
public
static
final
Long
[]
MEDICAL_INSURANCE_TEMPLET_ID
=
{
63L
};
}
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/dao/RightsSettingDAO.java
0 → 100644
View file @
f9389f97
package
com
.
pcloud
.
book
.
rightsSetting
.
dao
;
import
com.pcloud.book.rightsSetting.dto.RightsSettingDto
;
import
com.pcloud.book.rightsSetting.entity.RightsSetting
;
import
com.pcloud.common.core.dao.BaseDao
;
public
interface
RightsSettingDAO
extends
BaseDao
<
RightsSetting
>
{
int
deleteByPrimaryKey
(
Long
id
);
RightsSetting
selectByPrimaryKey
(
Long
id
);
int
updateByPrimaryKeySelective
(
RightsSetting
record
);
int
updateByPrimaryKey
(
RightsSetting
record
);
RightsSettingDto
getByLabel
(
Long
firstClassify
,
Long
secondClassify
,
Long
gradeLabelId
,
Long
subjectLabelId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/dao/RightsSettingMapper.java
0 → 100644
View file @
f9389f97
package
com
.
pcloud
.
book
.
rightsSetting
.
dao
;
import
com.pcloud.book.rightsSetting.entity.RightsSetting
;
public
interface
RightsSettingMapper
{
int
deleteByPrimaryKey
(
Long
id
);
int
insert
(
RightsSetting
record
);
int
insertSelective
(
RightsSetting
record
);
RightsSetting
selectByPrimaryKey
(
Long
id
);
int
updateByPrimaryKeySelective
(
RightsSetting
record
);
int
updateByPrimaryKey
(
RightsSetting
record
);
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/dao/check/RightsSettingCheck.java
0 → 100644
View file @
f9389f97
package
com
.
pcloud
.
book
.
rightsSetting
.
dao
.
check
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.rightsSetting.entity.RightsSetting
;
import
com.pcloud.common.utils.string.StringUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
@Component
(
"权益设置参数校验"
)
@Slf4j
public
class
RightsSettingCheck
{
public
void
rightsSettingCheck
(
RightsSetting
rightsSetting
)
{
log
.
info
(
"新增权益设置参数校验"
);
if
(
null
==
rightsSetting
){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"参数为空!"
);
}
if
(
StringUtil
.
isEmpty
(
rightsSetting
.
getIntroduce
())){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"权益介绍为空!"
);
}
if
(
StringUtil
.
isEmpty
(
rightsSetting
.
getDetail
())){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"权益详情为空!"
);
}
if
(
null
==
rightsSetting
.
getCount
()){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"权益个数为空!"
);
}
if
(
null
==
rightsSetting
.
getFirstClassify
()){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"分类为空!"
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/dao/impl/RightsSettingDAOImpl.java
0 → 100644
View file @
f9389f97
package
com
.
pcloud
.
book
.
rightsSetting
.
dao
.
impl
;
import
com.pcloud.book.rightsSetting.dao.RightsSettingDAO
;
import
com.pcloud.book.rightsSetting.dto.RightsSettingDto
;
import
com.pcloud.book.rightsSetting.entity.RightsSetting
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Component
;
import
java.util.HashMap
;
import
java.util.Map
;
@Component
public
class
RightsSettingDAOImpl
extends
BaseDaoImpl
<
RightsSetting
>
implements
RightsSettingDAO
{
@Override
public
int
deleteByPrimaryKey
(
Long
id
)
{
return
super
.
getSqlSession
().
delete
(
getStatement
(
"deleteByPrimaryKey"
),
id
);
}
@Override
public
RightsSetting
selectByPrimaryKey
(
Long
id
)
{
return
super
.
getSqlSession
().
selectOne
(
getStatement
(
"selectByPrimaryKey"
),
id
);
}
@Override
public
int
updateByPrimaryKeySelective
(
RightsSetting
record
)
{
return
super
.
getSqlSession
().
update
(
getStatement
(
"updateByPrimaryKeySelective"
),
record
);
}
@Override
public
int
updateByPrimaryKey
(
RightsSetting
record
)
{
return
super
.
getSqlSession
().
update
(
getStatement
(
"updateByPrimaryKeySelective"
),
record
);
}
@Override
public
RightsSettingDto
getByLabel
(
Long
firstClassify
,
Long
secondClassify
,
Long
gradeLabelId
,
Long
subjectLabelId
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"firstClassify"
,
firstClassify
);
paramMap
.
put
(
"secondClassify"
,
secondClassify
);
paramMap
.
put
(
"gradeLabelId"
,
gradeLabelId
);
paramMap
.
put
(
"subjectLabelId"
,
subjectLabelId
);
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getByLabel"
),
paramMap
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/dto/RightsSettingDto.java
0 → 100644
View file @
f9389f97
package
com
.
pcloud
.
book
.
rightsSetting
.
dto
;
import
com.pcloud.book.rightsSetting.entity.RightsSetting
;
import
lombok.Data
;
@Data
public
class
RightsSettingDto
extends
RightsSetting
{
private
String
firstClassifyContent
;
private
String
secondClassifyContent
;
private
String
gradeLabelIdContent
;
private
String
subjectLabelIdContent
;
}
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/entity/RightsSetting.java
0 → 100644
View file @
f9389f97
package
com
.
pcloud
.
book
.
rightsSetting
.
entity
;
import
com.pcloud.common.entity.BaseEntity
;
import
lombok.Data
;
@Data
public
class
RightsSetting
extends
BaseEntity
{
private
String
introduce
;
private
String
detail
;
private
Integer
count
;
private
Long
firstClassify
;
private
Long
secondClassify
;
private
Long
gradeLabelId
;
private
Long
subjectLabelId
;
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/facade/RightsSettingFacede.java
0 → 100644
View file @
f9389f97
package
com
.
pcloud
.
book
.
rightsSetting
.
facade
;
import
com.pcloud.book.rightsSetting.biz.RightsSettingBiz
;
import
com.pcloud.book.rightsSetting.dto.RightsSettingDto
;
import
com.pcloud.book.rightsSetting.entity.RightsSetting
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.permission.PermissionException
;
import
com.pcloud.common.utils.SessionUtil
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestHeader
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
@RequestMapping
(
"rightsSetting"
)
@RestController
(
"rightsSettingFacede"
)
public
class
RightsSettingFacede
{
@Autowired
private
RightsSettingBiz
rightsSettingBiz
;
@PostMapping
(
"addRightsSetting"
)
public
ResponseDto
<
Long
>
addRightsSetting
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
RightsSetting
rightsSetting
)
throws
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
return
new
ResponseDto
<
Long
>(
rightsSettingBiz
.
addRightsSetting
(
rightsSetting
));
}
@GetMapping
(
"deleteRightsSetting"
)
public
ResponseDto
<?>
deleteRightsSetting
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
"id"
)
Long
id
)
throws
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
rightsSettingBiz
.
deleteRightsSetting
(
id
);
return
new
ResponseDto
<>();
}
@PostMapping
(
"updateRightsSetting"
)
public
ResponseDto
<?>
updateRightsSetting
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
RightsSetting
rightsSetting
)
throws
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
rightsSettingBiz
.
updateRightsSetting
(
rightsSetting
);
return
new
ResponseDto
<>();
}
@GetMapping
(
"getRightsSetting"
)
public
ResponseDto
<
RightsSetting
>
getRightsSetting
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
"id"
)
Long
id
)
throws
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
return
new
ResponseDto
<
RightsSetting
>(
rightsSettingBiz
.
getRightsSetting
(
id
));
}
@GetMapping
(
"listRightsSettingPage"
)
public
ResponseDto
<
PageBeanNew
<
RightsSettingDto
>>
listRightsSettingPage
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
"currentPage"
)
Integer
currentPage
,
@RequestParam
(
"numPerPage"
)
Integer
numPerPage
,
@RequestParam
(
value
=
"firstClassify"
,
required
=
false
)
Long
firstClassify
,
@RequestParam
(
value
=
"secondClassify"
,
required
=
false
)
Long
secondClassify
,
@RequestParam
(
value
=
"gradeLabelId"
,
required
=
false
)
Long
gradeLabelId
,
@RequestParam
(
value
=
"subjectLabelId"
,
required
=
false
)
Long
subjectLabelId
)
throws
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
RightsSetting
rightsSetting
=
new
RightsSetting
();
rightsSetting
.
setFirstClassify
(
firstClassify
);
rightsSetting
.
setSecondClassify
(
secondClassify
);
rightsSetting
.
setGradeLabelId
(
gradeLabelId
);
rightsSetting
.
setSubjectLabelId
(
subjectLabelId
);
return
new
ResponseDto
<
PageBeanNew
<
RightsSettingDto
>>(
rightsSettingBiz
.
listRightsSettingPage
(
currentPage
,
numPerPage
,
rightsSetting
));
}
@ApiOperation
(
"获取读者数量-每天自增"
)
@GetMapping
(
"getUserCount"
)
public
ResponseDto
<
Integer
>
getUserCount
(){
return
new
ResponseDto
<>(
rightsSettingBiz
.
getUserCount
());
}
}
\ No newline at end of file
pcloud-service-book/src/main/resources/generatorConfig.xml
View file @
f9389f97
...
...
@@ -5,7 +5,7 @@
<generatorConfiguration>
<classPathEntry
location=
"
C:\work\re
pository\mysql\mysql-connector-java\5.1.44\mysql-connector-java-5.1.44.jar"
/>
location=
"
E:\work\res
pository\mysql\mysql-connector-java\5.1.44\mysql-connector-java-5.1.44.jar"
/>
<context
id=
"my"
targetRuntime=
"MyBatis3"
>
<commentGenerator>
<property
name=
"suppressDate"
value=
"false"
/>
...
...
@@ -16,19 +16,19 @@
connectionURL=
"jdbc:mysql://192.168.92.41:3306/book"
userId=
"root"
password=
"LGSC2016.lgsc"
/>
<javaModelGenerator
targetPackage=
"com.pcloud.book"
targetProject=
"
C:\project\rays\个人中心\pcloud-book\pcloud-service-book\src\main\resource
"
>
<javaModelGenerator
targetPackage=
"com.pcloud.book
.rightsSetting.entity
"
targetProject=
"
src\main\java
"
>
<property
name=
"enableSubPackages"
value=
"true"
/>
<property
name=
"trimStrings"
value=
"true"
/>
</javaModelGenerator>
<sqlMapGenerator
targetPackage=
"
com.pcloud.book
"
targetProject=
"
C:\project\rays\个人中心\pcloud-book\pcloud-service-book\src\main\resource
"
>
<sqlMapGenerator
targetPackage=
"
mapper.rightssetting
"
targetProject=
"
src\main\resources
"
>
<property
name=
"enableSubPackages"
value=
"true"
/>
</sqlMapGenerator>
<javaClientGenerator
targetPackage=
"com.pcloud.book"
targetProject=
"
C:\project\rays\个人中心\pcloud-book\pcloud-service-book\src\main\resource
"
type=
"XMLMAPPER"
>
<javaClientGenerator
targetPackage=
"com.pcloud.book
.rightsSetting.dao
"
targetProject=
"
src\main\java
"
type=
"XMLMAPPER"
>
<property
name=
"enableSubPackages"
value=
"true"
/>
</javaClientGenerator>
...
...
@@ -38,7 +38,7 @@
selectByExampleQueryId="false">
</table>-->
<table
tableName=
"
mini_user_classify"
domainObjectName=
"MiniUserClassify
"
<table
tableName=
"
rights_setting"
domainObjectName=
"RightsSetting
"
enableCountByExample=
"false"
enableUpdateByExample=
"false"
enableDeleteByExample=
"false"
enableSelectByExample=
"false"
selectByExampleQueryId=
"false"
>
...
...
pcloud-service-book/src/main/resources/mapper/book/BookAdviser.Mapper.xml
View file @
f9389f97
...
...
@@ -16,6 +16,10 @@
<result
column=
"IS_MAIN_EDITOR"
property=
"isMainEditor"
jdbcType=
"BIT"
/>
<result
column=
"IS_DELETE"
property=
"isDelete"
jdbcType=
"BIT"
/>
<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"
/>
</resultMap>
<resultMap
id=
"manageAdviserMap"
type=
"adviserManageDto"
>
...
...
@@ -113,7 +117,9 @@
<!-- 批量获取书籍信息 -->
<select
id=
"getBase"
resultMap=
"bookAdviserMap"
parameterType=
"map"
>
SELECT
BOOK_ADVISER_ID, BOOK_ID, TEMPLET_ID, CHANNEL_ID, ADVISER_ID, IS_DELETE
BOOK_ADVISER_ID, BOOK_ID, TEMPLET_ID, CHANNEL_ID, ADVISER_ID, IS_DELETE,
TEMPLET_ID,SECOND_TEMPLET_ID,
GRA_LABEL_ID,SUB_LABEL_ID,VER_LABEL_ID,AREA_LABEL_ID
FROM
BOOK_ADVISER
WHERE
...
...
pcloud-service-book/src/main/resources/mapper/group/BookGroupMapper.xml
View file @
f9389f97
...
...
@@ -459,7 +459,9 @@
bg.is_invite_group,
b.book_name,
b.cover_img book_img,
b.isbn
b.isbn,
bg.channel_id,
bg.create_user
FROM
book_group bg
LEFT JOIN book b ON bg.book_id = b.BOOK_ID
...
...
pcloud-service-book/src/main/resources/mapper/rightssetting/RightsSettingMapper.xml
0 → 100644
View file @
f9389f97
<?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.dao.impl.RightsSettingDAOImpl"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.rightsSetting.entity.RightsSetting"
>
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"introduce"
property=
"introduce"
jdbcType=
"VARCHAR"
/>
<result
column=
"detail"
property=
"detail"
jdbcType=
"VARCHAR"
/>
<result
column=
"count"
property=
"count"
jdbcType=
"INTEGER"
/>
<result
column=
"first_classify"
property=
"firstClassify"
jdbcType=
"BIGINT"
/>
<result
column=
"second_classify"
property=
"secondClassify"
jdbcType=
"BIGINT"
/>
<result
column=
"grade_label_id"
property=
"gradeLabelId"
jdbcType=
"BIGINT"
/>
<result
column=
"subject_label_id"
property=
"subjectLabelId"
jdbcType=
"BIGINT"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<resultMap
id=
"DtoResultMap"
type=
"com.pcloud.book.rightsSetting.dto.RightsSettingDto"
>
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"introduce"
property=
"introduce"
jdbcType=
"VARCHAR"
/>
<result
column=
"detail"
property=
"detail"
jdbcType=
"VARCHAR"
/>
<result
column=
"count"
property=
"count"
jdbcType=
"INTEGER"
/>
<result
column=
"first_classify"
property=
"firstClassify"
jdbcType=
"BIGINT"
/>
<result
column=
"second_classify"
property=
"secondClassify"
jdbcType=
"BIGINT"
/>
<result
column=
"grade_label_id"
property=
"gradeLabelId"
jdbcType=
"BIGINT"
/>
<result
column=
"subject_label_id"
property=
"subjectLabelId"
jdbcType=
"BIGINT"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, introduce, detail, count, first_classify, second_classify, grade_label_id, subject_label_id,
create_time, update_time
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Long"
>
select
<include
refid=
"Base_Column_List"
/>
from rights_setting
where id = #{id,jdbcType=BIGINT}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
delete from rights_setting
where id = #{id,jdbcType=BIGINT}
</delete>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.rightsSetting.entity.RightsSetting"
>
insert into rights_setting (id, introduce, detail,
count, first_classify, second_classify,
grade_label_id, subject_label_id, create_time,
update_time)
values (#{id,jdbcType=BIGINT}, #{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})
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.pcloud.book.rightsSetting.entity.RightsSetting"
>
update rights_setting
<set
>
<if
test=
"introduce != null"
>
introduce = #{introduce,jdbcType=VARCHAR},
</if>
<if
test=
"detail != null"
>
detail = #{detail,jdbcType=VARCHAR},
</if>
<if
test=
"count != null"
>
count = #{count,jdbcType=INTEGER},
</if>
<if
test=
"firstClassify != null"
>
first_classify = #{firstClassify,jdbcType=BIGINT},
</if>
<if
test=
"secondClassify != null"
>
second_classify = #{secondClassify,jdbcType=BIGINT},
</if>
<if
test=
"gradeLabelId != null"
>
grade_label_id = #{gradeLabelId,jdbcType=BIGINT},
</if>
<if
test=
"subjectLabelId != null"
>
subject_label_id = #{subjectLabelId,jdbcType=BIGINT},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.pcloud.book.rightsSetting.entity.RightsSetting"
>
update rights_setting
set introduce = #{introduce,jdbcType=VARCHAR},
detail = #{detail,jdbcType=VARCHAR},
count = #{count,jdbcType=INTEGER},
first_classify = #{firstClassify,jdbcType=BIGINT},
second_classify = #{secondClassify,jdbcType=BIGINT},
grade_label_id = #{gradeLabelId,jdbcType=BIGINT},
subject_label_id = #{subjectLabelId,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
<select
id=
"listRightsSettingPage"
parameterType=
"map"
resultMap=
"DtoResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from
rights_setting
<where>
<if
test=
"firstClassify != null"
>
first_classify = #{firstClassify}
</if>
<if
test=
"secondClassify != null"
>
and second_classify = #{secondClassify}
</if>
<if
test=
"gradeLabelId != null"
>
and grade_label_id = #{gradeLabelId}
</if>
<if
test=
"subjectLabelId != null"
>
and subject_label_id = #{subjectLabelId}
</if>
</where>
order by create_time desc
</select>
<select
id=
"getByLabel"
parameterType=
"map"
resultMap=
"DtoResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from
rights_setting
where 1=1
<if
test=
"firstClassify != null"
>
and first_classify = #{firstClassify}
</if>
<if
test=
"secondClassify != null"
>
and second_classify = #{secondClassify}
</if>
<if
test=
"gradeLabelId != null"
>
and grade_label_id = #{gradeLabelId}
</if>
<if
test=
"subjectLabelId != null"
>
and subject_label_id = #{subjectLabelId}
</if>
limit 1
</select>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment