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
70ce8361
Commit
70ce8361
authored
Apr 29, 2020
by
吴博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1002825 小程序配置读书计划
parent
8e45e3a6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
318 additions
and
7 deletions
+318
-7
BookBizImpl.java
.../main/java/com/pcloud/book/book/biz/impl/BookBizImpl.java
+5
-0
BookSet.java
...-book/src/main/java/com/pcloud/book/book/set/BookSet.java
+21
-0
CustomPlanBiz.java
...c/main/java/com/pcloud/book/custom/biz/CustomPlanBiz.java
+2
-0
CustomPlanBizImpl.java
...va/com/pcloud/book/custom/biz/impl/CustomPlanBizImpl.java
+6
-0
CustomPlanMapper.java
.../java/com/pcloud/book/custom/mapper/CustomPlanMapper.java
+3
-0
RightsSettingBizImpl.java
...oud/book/rightsSetting/biz/impl/RightsSettingBizImpl.java
+0
-0
RightsCustomRelationDao.java
...cloud/book/rightsSetting/dao/RightsCustomRelationDao.java
+20
-0
RightsReadPlanDao.java
.../com/pcloud/book/rightsSetting/dao/RightsReadPlanDao.java
+16
-0
RightsSettingItemDao.java
...m/pcloud/book/rightsSetting/dao/RightsSettingItemDao.java
+4
-0
RightsCustomRelationDaoImpl.java
...k/rightsSetting/dao/impl/RightsCustomRelationDaoImpl.java
+26
-0
RightsReadPlanDaoImpl.java
...ud/book/rightsSetting/dao/impl/RightsReadPlanDaoImpl.java
+18
-0
RightsSettingItemDaoImpl.java
...book/rightsSetting/dao/impl/RightsSettingItemDaoImpl.java
+16
-0
RightsCustomRelation.java
...cloud/book/rightsSetting/entity/RightsCustomRelation.java
+20
-0
RightsReadPlan.java
.../com/pcloud/book/rightsSetting/entity/RightsReadPlan.java
+26
-0
RightsSettingItem.java
...m/pcloud/book/rightsSetting/entity/RightsSettingItem.java
+16
-0
RightsNowItemType.java
...om/pcloud/book/rightsSetting/enums/RightsNowItemType.java
+4
-2
CustomPlanMapper.xml
...ook/src/main/resources/mapper/custom/CustomPlanMapper.xml
+11
-0
RightsCustomRelation.xml
...n/resources/mapper/rightssetting/RightsCustomRelation.xml
+40
-0
RightsReadPlan.xml
...rc/main/resources/mapper/rightssetting/RightsReadPlan.xml
+37
-0
RightsSettingItemMapper.xml
...esources/mapper/rightssetting/RightsSettingItemMapper.xml
+27
-5
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookBizImpl.java
View file @
70ce8361
...
...
@@ -428,6 +428,11 @@ public class BookBizImpl implements BookBiz {
BookDto
bookDto
=
bookCache
.
getBookToRedis
(
bookId
);
if
(
null
==
bookDto
)
{
bookDto
=
bookDao
.
getBaseById
(
bookId
);
BookAdviserDto
bookAdviserDto
=
bookAdviserBiz
.
getOneMainBook
(
bookId
);
if
(
null
!=
bookDto
&&
null
!=
bookAdviserDto
){
bookDto
.
setTempletId
(
bookAdviserDto
.
getTempletId
());
bookSet
.
setFirstTemplateName
(
bookDto
);
}
// 将数据存入redis
bookCache
.
setBookToRedis
(
bookDto
);
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/book/set/BookSet.java
View file @
70ce8361
...
...
@@ -1742,4 +1742,25 @@ public class BookSet {
}
}
public
void
setFirstTemplateName
(
BookDto
bookDto
)
{
LOGGER
.
info
(
"设置一级模板名称【START】"
);
if
(
bookDto
==
null
||
bookDto
.
getTempletId
()
==
null
)
{
return
;
}
List
<
Long
>
templetIds
=
new
ArrayList
<>();
if
(
Objects
.
nonNull
(
bookDto
.
getTempletId
()))
{
templetIds
.
add
(
bookDto
.
getTempletId
());
}
Map
<
Long
,
AssistTempletDTO
>
assistTempletMap
=
assistTempletConsr
.
mapByIds4Classify
(
templetIds
);
if
(
MapUtils
.
isEmpty
(
assistTempletMap
))
{
return
;
}
if
(
Objects
.
nonNull
(
bookDto
.
getTempletId
()))
{
setBookDtoTempletInfo
(
assistTempletMap
,
bookDto
,
bookDto
.
getTempletId
());
}
LOGGER
.
info
(
"设置模板名称【END】"
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/custom/biz/CustomPlanBiz.java
View file @
70ce8361
...
...
@@ -50,4 +50,6 @@ public interface CustomPlanBiz {
UserBookServiceVO
getUserBookServiceById
(
Long
userBookServiceId
);
List
<
PlanReadTypeDto
>
getPlanReadTypesByBookId
(
Long
bookId
);
List
<
CustomPlan
>
listByCustomPlanIds
(
List
<
Long
>
customPlanIds
);
}
pcloud-service-book/src/main/java/com/pcloud/book/custom/biz/impl/CustomPlanBizImpl.java
View file @
70ce8361
...
...
@@ -536,4 +536,10 @@ public class CustomPlanBizImpl implements CustomPlanBiz {
List
<
PlanReadTypeDto
>
list
=
customPlanMapper
.
getPlanReadTypesByBookId
(
bookId
);
return
list
;
}
@Override
@ParamLog
(
value
=
"批量获取定制服务"
,
isAfterReturn
=
false
)
public
List
<
CustomPlan
>
listByCustomPlanIds
(
List
<
Long
>
customPlanIds
)
{
return
customPlanMapper
.
getCustomPlanByIds
(
customPlanIds
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/custom/mapper/CustomPlanMapper.java
View file @
70ce8361
...
...
@@ -39,4 +39,6 @@ public interface CustomPlanMapper {
CustomPlan
getLastCustomPlan
(
@Param
(
"bookIds"
)
List
<
Long
>
bookIds
,
@Param
(
"readType"
)
Integer
readType
);
CustomPlan
getLastCustomPlanByBookIds
(
@Param
(
"bookIds"
)
List
<
Long
>
bookIds
);
List
<
CustomPlan
>
getCustomPlanByIds
(
@Param
(
"customPlanIds"
)
List
<
Long
>
customPlanIds
);
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/biz/impl/RightsSettingBizImpl.java
View file @
70ce8361
This diff is collapsed.
Click to expand it.
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/dao/RightsCustomRelationDao.java
0 → 100644
View file @
70ce8361
package
com
.
pcloud
.
book
.
rightsSetting
.
dao
;
import
com.pcloud.book.rightsSetting.entity.RightsCustomRelation
;
import
com.pcloud.book.rightsSetting.entity.RightsReadPlan
;
import
com.pcloud.common.core.dao.BaseDao
;
import
java.util.List
;
/**
* @Description
* @Author zengpo
* @Date 2020/4/27 17:44
**/
public
interface
RightsCustomRelationDao
extends
BaseDao
<
RightsCustomRelation
>
{
List
<
RightsCustomRelation
>
getCustomByItemIds
(
List
<
Long
>
itemIdList
);
}
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/dao/RightsReadPlanDao.java
0 → 100644
View file @
70ce8361
package
com
.
pcloud
.
book
.
rightsSetting
.
dao
;
import
com.pcloud.book.rightsSetting.entity.RightsReadPlan
;
import
com.pcloud.common.core.dao.BaseDao
;
/**
* @Description
* @Author zengpo
* @Date 2020/4/27 17:44
**/
public
interface
RightsReadPlanDao
extends
BaseDao
<
RightsReadPlan
>
{
}
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/dao/RightsSettingItemDao.java
View file @
70ce8361
...
...
@@ -39,4 +39,7 @@ public interface RightsSettingItemDao extends BaseDao<RightsSettingItem>{
*/
List
<
RightsSettingClassify
>
getAllRightsClassify
(
String
rightsType
);
List
<
RightsSettingItem
>
getItemByRightsIdAndType
(
Long
rightsSettingId
,
String
rightsType
);
List
<
RightsSettingItem
>
getItemsByRightsSettingId4Read
(
Long
rightsSettingId
,
String
rightsType
);
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/dao/impl/RightsCustomRelationDaoImpl.java
0 → 100644
View file @
70ce8361
package
com
.
pcloud
.
book
.
rightsSetting
.
dao
.
impl
;
import
com.pcloud.book.rightsSetting.dao.RightsCustomRelationDao
;
import
com.pcloud.book.rightsSetting.dao.RightsReadPlanDao
;
import
com.pcloud.book.rightsSetting.entity.RightsCustomRelation
;
import
com.pcloud.book.rightsSetting.entity.RightsReadPlan
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
/**
* @Description
* @Author zengpo
* @Date 2020/4/27 17:44
**/
@Component
(
"rightsCustomRelationDao"
)
public
class
RightsCustomRelationDaoImpl
extends
BaseDaoImpl
<
RightsCustomRelation
>
implements
RightsCustomRelationDao
{
@Override
public
List
<
RightsCustomRelation
>
getCustomByItemIds
(
List
<
Long
>
itemIdList
)
{
return
getSqlSession
().
selectList
(
getStatement
(
"getCustomByItemIds"
),
itemIdList
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/dao/impl/RightsReadPlanDaoImpl.java
0 → 100644
View file @
70ce8361
package
com
.
pcloud
.
book
.
rightsSetting
.
dao
.
impl
;
import
com.pcloud.book.rightsSetting.dao.RightsReadPlanDao
;
import
com.pcloud.book.rightsSetting.entity.RightsReadPlan
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Component
;
/**
* @Description
* @Author zengpo
* @Date 2020/4/27 17:44
**/
@Component
(
"rightsReadPlanDao"
)
public
class
RightsReadPlanDaoImpl
extends
BaseDaoImpl
<
RightsReadPlan
>
implements
RightsReadPlanDao
{
}
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/dao/impl/RightsSettingItemDaoImpl.java
View file @
70ce8361
...
...
@@ -38,4 +38,20 @@ public class RightsSettingItemDaoImpl extends BaseDaoImpl<RightsSettingItem> imp
map
.
put
(
"rightsType"
,
rightsType
);
return
getSessionTemplate
().
selectList
(
getStatement
(
"getAllRightsClassify"
),
map
);
}
@Override
public
List
<
RightsSettingItem
>
getItemByRightsIdAndType
(
Long
rightsSettingId
,
String
rightsType
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"rightsSettingId"
,
rightsSettingId
);
map
.
put
(
"rightsType"
,
rightsType
);
return
getSessionTemplate
().
selectList
(
getStatement
(
"getItemByRightsIdAndType"
),
map
);
}
@Override
public
List
<
RightsSettingItem
>
getItemsByRightsSettingId4Read
(
Long
rightsSettingId
,
String
rightsType
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"rightsSettingId"
,
rightsSettingId
);
map
.
put
(
"rightsType"
,
rightsType
);
return
getSessionTemplate
().
selectList
(
getStatement
(
"getItemsByRightsSettingId4Read"
),
map
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/entity/RightsCustomRelation.java
0 → 100644
View file @
70ce8361
package
com
.
pcloud
.
book
.
rightsSetting
.
entity
;
import
com.pcloud.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @Description
* @Author zengpo
* @Date 2020/4/27 17:41
**/
@Data
public
class
RightsCustomRelation
extends
BaseEntity
{
@ApiModelProperty
(
"定制服务方案id"
)
private
Long
customPlanId
;
@ApiModelProperty
(
"权益内容id"
)
private
Long
rightsSettingItemId
;
}
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/entity/RightsReadPlan.java
0 → 100644
View file @
70ce8361
package
com
.
pcloud
.
book
.
rightsSetting
.
entity
;
import
com.pcloud.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @Description
* @Author zengpo
* @Date 2020/4/27 17:41
**/
@Data
public
class
RightsReadPlan
extends
BaseEntity
{
@ApiModelProperty
(
"主键"
)
private
Long
id
;
@ApiModelProperty
(
"权益内容id"
)
private
Long
rightsSettingItemId
;
@ApiModelProperty
(
"本书阅读计划开关 0关闭 1开启"
)
private
Integer
isOpen
;
@ApiModelProperty
(
"服务说明"
)
private
String
serviceDesc
;
}
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/entity/RightsSettingItem.java
View file @
70ce8361
...
...
@@ -2,12 +2,14 @@ package com.pcloud.book.rightsSetting.entity;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.pcloud.book.applet.dto.AppletNewsDTO
;
import
com.pcloud.book.custom.entity.CustomPlan
;
import
com.pcloud.common.entity.BaseEntity
;
import
java.util.Date
;
import
java.io.Serializable
;
import
java.util.List
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
...
...
@@ -54,4 +56,17 @@ public class RightsSettingItem extends BaseEntity {
* 资讯
*/
private
List
<
AppletNewsDTO
>
appletNewsDTOS
;
@ApiModelProperty
(
"本书阅读计划开关 0关闭 1开启"
)
private
Integer
isOpen
;
@ApiModelProperty
(
"服务说明"
)
private
String
serviceDesc
;
@ApiModelProperty
(
"定制服务方案集合"
)
private
List
<
CustomPlan
>
customPlanList
;
@ApiModelProperty
(
"唯一键"
)
private
String
uuid
;
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/enums/RightsNowItemType.java
View file @
70ce8361
...
...
@@ -27,11 +27,13 @@ public enum RightsNowItemType {
/**
* 6 配套资料
*/
SERVES
(
6
)
;
SERVES
(
6
)
,
/**
*
值
*
7线上学习/阅读提醒
*/
ONLINE_REMIND
(
7
);
public
final
Integer
value
;
RightsNowItemType
(
Integer
value
)
{
...
...
pcloud-service-book/src/main/resources/mapper/custom/CustomPlanMapper.xml
View file @
70ce8361
...
...
@@ -261,4 +261,14 @@
ORDER BY id DESC
LIMIT 1
</select>
<select
id=
"getCustomPlanByIds"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from custom_plan
where id IN
<foreach
collection=
"customPlanIds"
item=
"item"
separator=
","
open=
"("
close=
")"
>
${item}
</foreach>
ORDER BY id DESC
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/rightssetting/RightsCustomRelation.xml
0 → 100644
View file @
70ce8361
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.pcloud.book.rightsSetting.dao.impl.RightsCustomRelationDaoImpl"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.rightsSetting.entity.RightsCustomRelation"
>
<result
property=
"rightsSettingItemId"
column=
"rights_setting_item_id"
jdbcType=
"BIGINT"
/>
<result
property=
"customPlanId"
column=
"custom_plan_id"
jdbcType=
"BIGINT"
/>
<result
property=
"createTime"
column=
"create_time"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"updateTime"
column=
"update_time"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
rights_setting_item_id, custom_plan_id, create_time, update_time
</sql>
<!--批量新增-->
<insert
id=
"batchInsert"
useGeneratedKeys=
"true"
parameterType=
"java.util.List"
>
insert into book.rights_custom_relation (
rights_setting_item_id, custom_plan_id, create_time, update_time
)
values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(
#{item.rightsSettingItemId},
#{item.customPlanId},
NOW(),
NOW()
)
</foreach>
</insert>
<select
id=
"getCustomByItemIds"
parameterType=
"java.util.List"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from rights_custom_relation where 1=1 and
rights_setting_item_id IN
<foreach
collection=
"list"
item=
"item"
separator=
","
open=
"("
close=
")"
>
${item}
</foreach>
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/rightssetting/RightsReadPlan.xml
0 → 100644
View file @
70ce8361
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.pcloud.book.rightsSetting.dao.impl.RightsReadPlanDaoImpl"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.rightsSetting.entity.RightsReadPlan"
>
<id
property=
"id"
column=
"id"
jdbcType=
"BIGINT"
/>
<result
property=
"rightsSettingItemId"
column=
"rights_setting_item_id"
jdbcType=
"BIGINT"
/>
<result
property=
"isOpen"
column=
"is_open"
jdbcType=
"INTEGER"
/>
<result
property=
"serviceDesc"
column=
"service_desc"
jdbcType=
"VARCHAR"
/>
<result
property=
"createTime"
column=
"create_time"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"updateTime"
column=
"update_time"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, rights_setting_item_id, is_open, service_desc, create_time, update_time
</sql>
<!--批量新增-->
<insert
id=
"batchInsert"
useGeneratedKeys=
"true"
parameterType=
"java.util.List"
>
insert into book.rights_read_plan (
rights_setting_item_id, is_open, service_desc, create_time, update_time
)
values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(
#{item.rightsSettingItemId},
#{item.isOpen},
#{item.serviceDesc},
NOW(),
NOW()
)
</foreach>
</insert>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/rightssetting/RightsSettingItemMapper.xml
View file @
70ce8361
...
...
@@ -10,6 +10,7 @@
<result
property=
"description"
column=
"description"
jdbcType=
"VARCHAR"
/>
<result
property=
"createTime"
column=
"create_time"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"title"
column=
"title"
jdbcType=
"VARCHAR"
/>
<result
property=
"uuid"
column=
"uuid"
jdbcType=
"VARCHAR"
/>
</resultMap>
<!--通过实体作为筛选条件查询-->
...
...
@@ -17,8 +18,9 @@
select
i.id, i.rights_setting_id rightsSettingId,
i.rights_type rightsType, i.rights_classify_id rightsClassifyId,
i.description, i.create_time createTime, i.title
i.description, i.create_time createTime, i.title
,i.uuid,IFNULL(p.is_open,0) isOpen,p.service_desc serviceDesc
from book.rights_setting_item i
left join book.rights_read_plan p on i.id=p.rights_setting_item_id
<where>
<if
test=
"id != null"
>
and i.id = #{id}
...
...
@@ -38,8 +40,8 @@
<!--新增所有列-->
<insert
id=
"insert"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
insert into book.rights_setting_item(rights_setting_id, rights_type, rights_classify_id, description, create_time,title)
values (#{rightsSettingId}, #{rightsType}, #{rightsClassifyId}, #{description}, NOW(), #{title})
insert into book.rights_setting_item(rights_setting_id, rights_type, rights_classify_id, description, create_time,title
,uuid
)
values (#{rightsSettingId}, #{rightsType}, #{rightsClassifyId}, #{description}, NOW(), #{title}
,#{uuid}
)
</insert>
<!--通过权益主键删除-->
...
...
@@ -54,7 +56,7 @@
<!--批量新增-->
<insert
id=
"batchInsert"
useGeneratedKeys=
"true"
parameterType=
"java.util.List"
>
insert into book.rights_setting_item (
rights_setting_id, rights_type, rights_classify_id, description, create_time,title
rights_setting_id, rights_type, rights_classify_id, description, create_time,title
,uuid
)
values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
...
...
@@ -64,7 +66,8 @@
#{item.rightsClassifyId,jdbcType=VARCHAR},
#{item.description,jdbcType=VARCHAR},
NOW(),
#{item.title}
#{item.title},
#{item.uuid}
)
</foreach>
</insert>
...
...
@@ -78,4 +81,22 @@
</if>
</select>
<select
id=
"getItemsByRightsSettingId4Read"
parameterType=
"map"
resultType=
"com.pcloud.book.rightsSetting.entity.RightsSettingItem"
>
select
i.id, i.rights_setting_id rightsSettingId,
i.rights_type rightsType, i.rights_classify_id rightsClassifyId,
i.description, i.create_time createTime, i.title,i.uuid,IFNULL(p.is_open,0) isOpen,p.service_desc serviceDesc
from book.rights_setting_item i
left join book.rights_read_plan p on i.id=p.rights_setting_item_id
<where>
<if
test=
"rightsSettingId != null"
>
and i.rights_setting_id = #{rightsSettingId}
</if>
<if
test=
"rightsType != null and rightsType != ''"
>
and i.rights_type = #{rightsType}
</if>
</where>
order by i.id asc
</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