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
bb4c44f4
Commit
bb4c44f4
authored
Aug 21, 2020
by
Administrator
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/1003454' into 'master'
feat: [1003454] 分类权益列表添加自定义编号 See merge request rays/pcloud-book!909
parents
db42a3ba
96589d7c
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
92 additions
and
9 deletions
+92
-9
RightsSettingBizImpl.java
...oud/book/rightsSetting/biz/impl/RightsSettingBizImpl.java
+23
-0
RightsSettingDAO.java
...a/com/pcloud/book/rightsSetting/dao/RightsSettingDAO.java
+5
-0
RightsSettingDAOImpl.java
...oud/book/rightsSetting/dao/impl/RightsSettingDAOImpl.java
+17
-0
RightsSettingDto.java
...a/com/pcloud/book/rightsSetting/dto/RightsSettingDto.java
+4
-0
RightsSetting.java
...a/com/pcloud/book/rightsSetting/entity/RightsSetting.java
+3
-1
RightsTypeEnum.java
...a/com/pcloud/book/rightsSetting/enums/RightsTypeEnum.java
+6
-1
GroupQrcode.Mapper.xml
...ok/src/main/resources/mapper/group/GroupQrcode.Mapper.xml
+3
-1
RightsSettingMapper.xml
...in/resources/mapper/rightssetting/RightsSettingMapper.xml
+31
-6
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/biz/impl/RightsSettingBizImpl.java
View file @
bb4c44f4
...
...
@@ -302,6 +302,14 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
paramMap
.
put
(
"volLabelId"
,
rightsSetting
.
getVolLabelId
());
paramMap
.
put
(
"verLabelId"
,
rightsSetting
.
getVerLabelId
());
}
if
(!
StringUtil
.
isEmpty
(
rightsSetting
.
getRightsNumber
()))
{
RightsSetting
exit
=
rightsSettingDAO
.
selctByNumber
(
rightsSetting
.
getRightsNumber
(),
rightsSetting
.
getRightsSettingType
());
if
(
exit
!=
null
&&
exit
.
getId
()
!=
null
)
{
if
(
rightsSetting
.
getId
()
==
null
||
Long
.
compare
(
exit
.
getId
(),
rightsSetting
.
getId
())
!=
0
)
{
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"编号已存在"
);
}
}
}
List
<
RightsSettingDto
>
list
=
rightsSettingDAO
.
listRightsSettingPage
(
paramMap
);
count
=
list
.
size
();
return
count
;
...
...
@@ -343,7 +351,22 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
}
else
if
(
Objects
.
equals
(
RightsTypeEnum
.
LONG_TERM
.
code
,
rightsSetting
.
getStepType
()))
{
// 更新每周、长期权益
updateRightsLongTerm
(
rightsSetting
);
}
else
if
(
Objects
.
equals
(
RightsTypeEnum
.
UP_NUMBER
.
code
,
rightsSetting
.
getStepType
()))
{
// 更新每周、长期权益
updateNumber
(
rightsSetting
);
}
}
private
void
updateNumber
(
RightsSetting
rightsSetting
)
{
if
(!
StringUtil
.
isEmpty
(
rightsSetting
.
getRightsNumber
())){
RightsSetting
exit
=
rightsSettingDAO
.
selctByNumber
(
rightsSetting
.
getRightsNumber
(),
rightsSetting
.
getRightsSettingType
());
if
(
exit
!=
null
&&
exit
.
getId
()
!=
null
)
{
if
(
rightsSetting
.
getId
()
==
null
||
Long
.
compare
(
exit
.
getId
(),
rightsSetting
.
getId
())
!=
0
)
{
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"编号已存在"
);
}
}
}
rightsSettingDAO
.
updateNumber
(
rightsSetting
.
getId
(),
rightsSetting
.
getRightsNumber
());
}
private
void
handleRightsSetting4Sort
(
RightsSetting
rightsSetting
)
{
...
...
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/dao/RightsSettingDAO.java
View file @
bb4c44f4
...
...
@@ -9,6 +9,11 @@ import java.util.List;
import
java.util.Map
;
public
interface
RightsSettingDAO
extends
BaseDao
<
RightsSetting
>
{
RightsSetting
selctByNumber
(
String
number
,
Integer
rightsSettingType
);
void
updateNumber
(
Long
id
,
String
number
);
int
deleteByPrimaryKey
(
Long
id
);
RightsSetting
selectByPrimaryKey
(
Long
id
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/dao/impl/RightsSettingDAOImpl.java
View file @
bb4c44f4
...
...
@@ -13,6 +13,23 @@ import java.util.Map;
@Component
public
class
RightsSettingDAOImpl
extends
BaseDaoImpl
<
RightsSetting
>
implements
RightsSettingDAO
{
@Override
public
RightsSetting
selctByNumber
(
String
number
,
Integer
rightsSettingType
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"rightsNumber"
,
number
);
paramMap
.
put
(
"rightsSettingType"
,
rightsSettingType
);
return
super
.
getSqlSession
().
selectOne
(
getStatement
(
"selctByNumber"
),
paramMap
);
}
@Override
public
void
updateNumber
(
Long
id
,
String
number
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"id"
,
id
);
paramMap
.
put
(
"rightsNumber"
,
number
);
super
.
getSqlSession
().
update
(
getStatement
(
"updateNumber"
),
paramMap
);
}
@Override
public
int
deleteByPrimaryKey
(
Long
id
)
{
return
super
.
getSqlSession
().
delete
(
getStatement
(
"deleteByPrimaryKey"
),
id
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/dto/RightsSettingDto.java
View file @
bb4c44f4
package
com
.
pcloud
.
book
.
rightsSetting
.
dto
;
import
com.pcloud.book.rightsSetting.entity.RightsSetting
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
public
class
RightsSettingDto
extends
RightsSetting
{
@ApiModelProperty
(
"权益编号"
)
private
String
rightsNumber
;
private
String
firstClassifyContent
;
private
String
secondClassifyContent
;
...
...
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/entity/RightsSetting.java
View file @
bb4c44f4
...
...
@@ -17,6 +17,9 @@ import org.hibernate.validator.constraints.Length;
@Data
public
class
RightsSetting
extends
BaseTempletClassify
{
@ApiModelProperty
(
"权益编号"
)
private
String
rightsNumber
;
private
String
introduce
;
private
String
detail
;
...
...
@@ -118,7 +121,6 @@ public class RightsSetting extends BaseTempletClassify {
*/
private
Long
volLabelId
;
@NotNull
(
message
=
"本书阅读指引不能为空"
)
@ApiModelProperty
(
"是否打开阅读指引 1:开 0:关"
)
private
Long
guideIsOpen
;
...
...
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/enums/RightsTypeEnum.java
View file @
bb4c44f4
...
...
@@ -22,7 +22,12 @@ public enum RightsTypeEnum {
/**
* 长期
*/
LONG_TERM
(
"LONG_TERM"
,
3
);
LONG_TERM
(
"LONG_TERM"
,
3
),
/**
* 修改编号
*/
UP_NUMBER
(
"UPDATE_NUMBER"
,
4
);
public
final
String
value
;
public
final
Integer
code
;
...
...
pcloud-service-book/src/main/resources/mapper/group/GroupQrcode.Mapper.xml
View file @
bb4c44f4
...
...
@@ -916,7 +916,8 @@
b.id id,
b.classify_id classifyId,
b.weixin_group_id weixinGroupId,
b.group_name groupName,
<!-- b.group_name groupName,-->
d.`name` groupName,
b.user_number userNumber,
b.qrcode_url qrcodeUrl,
c.related_book_group_id relatedBookGroupId,
...
...
@@ -937,6 +938,7 @@
AND a.is_delete = 0
AND b.is_delete = 0
AND c.is_delete = 0
AND d.is_delete = 0
GROUP BY a.id
ORDER BY d.create_time DESC
LIMIT 3
...
...
pcloud-service-book/src/main/resources/mapper/rightssetting/RightsSettingMapper.xml
View file @
bb4c44f4
...
...
@@ -3,6 +3,7 @@
<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=
"rights_number"
property=
"rightsNumber"
jdbcType=
"VARCHAR"
/>
<result
column=
"introduce"
property=
"introduce"
jdbcType=
"VARCHAR"
/>
<result
column=
"detail"
property=
"detail"
jdbcType=
"VARCHAR"
/>
<result
column=
"count"
property=
"count"
jdbcType=
"INTEGER"
/>
...
...
@@ -31,6 +32,7 @@
<resultMap
id=
"DtoResultMap"
type=
"com.pcloud.book.rightsSetting.dto.RightsSettingDto"
>
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"rights_number"
property=
"rightsNumber"
jdbcType=
"VARCHAR"
/>
<result
column=
"introduce"
property=
"introduce"
jdbcType=
"VARCHAR"
/>
<result
column=
"detail"
property=
"detail"
jdbcType=
"VARCHAR"
/>
<result
column=
"count"
property=
"count"
jdbcType=
"INTEGER"
/>
...
...
@@ -59,20 +61,20 @@
</collection>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, introduce, detail, count, first_classify, second_classify, grade_label_id, subject_label_id,
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
</sql>
<sql
id=
"Base_Column_List_own"
>
r.id, r.introduce, r.detail, r.count, r.first_classify, r.second_classify, r.grade_label_id, r.subject_label_id,
r.id,
r.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
</sql>
<sql
id=
"Base_Column_List_1"
>
r.id, r.introduce, r.detail, r.count, r.first_classify, r.second_classify, r.grade_label_id, r.subject_label_id,
r.id,
r.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
</sql>
...
...
@@ -88,13 +90,13 @@
where id = #{id,jdbcType=BIGINT}
</delete>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.rightsSetting.entity.RightsSetting"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into rights_setting (introduce, detail,
insert into rights_setting (
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)
values ( #{introduce,jdbcType=VARCHAR}, #{detail,jdbcType=VARCHAR},
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},
...
...
@@ -104,6 +106,9 @@
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.pcloud.book.rightsSetting.entity.RightsSetting"
>
update rights_setting
<set
>
<if
test=
"rightsNumber != null"
>
rights_number = #{rightsNumber,jdbcType=VARCHAR},
</if>
<if
test=
"introduce != null"
>
introduce = #{introduce,jdbcType=VARCHAR},
</if>
...
...
@@ -173,9 +178,18 @@
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update
id=
"updateNumber"
parameterType=
"map"
>
update rights_setting
set rights_number = #{rightsNumber,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.pcloud.book.rightsSetting.entity.RightsSetting"
>
update rights_setting
set introduce = #{introduce,jdbcType=VARCHAR},
rights_number = #{rightsNumber,jdbcType=VARCHAR},
detail = #{detail,jdbcType=VARCHAR},
count = #{count,jdbcType=INTEGER},
first_classify = #{firstClassify,jdbcType=BIGINT},
...
...
@@ -242,7 +256,7 @@
<select
id=
"listBookRightsSettingPage"
parameterType=
"map"
resultMap=
"DtoResultMap4Book"
>
select
r.id, r.introduce, r.detail, r.count, r.first_classify, r.second_classify, r.grade_label_id, r.subject_label_id,
r.id,
r.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, b.BOOK_NAME, r.vol_label_id,
r.ver_label_id, r.show_state
from
...
...
@@ -297,6 +311,17 @@
limit 1
</select>
<select
id=
"selctByNumber"
parameterType=
"map"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from
rights_setting r
WHERE
r.rights_number = #{rightsNumber,jdbcType=VARCHAR}
and rights_setting_type = #{rightsSettingType}
limit 1
</select>
<select
id=
"listByBookId"
parameterType=
"map"
resultMap=
"DtoResultMap"
>
select
<include
refid=
"Base_Column_List_own"
/>
...
...
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