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
5794ca48
Commit
5794ca48
authored
Aug 14, 2020
by
pansy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: [1002913] 资讯管理优化平行分类标签问题
parent
9033e9dd
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
401 additions
and
69 deletions
+401
-69
AppletNewsBiz.java
...c/main/java/com/pcloud/book/applet/biz/AppletNewsBiz.java
+7
-0
AppletNewsBizImpl.java
...va/com/pcloud/book/applet/biz/impl/AppletNewsBizImpl.java
+93
-10
AppletNewsCategoryDao.java
...ava/com/pcloud/book/applet/dao/AppletNewsCategoryDao.java
+20
-0
AppletNewsCategoryDaoImpl.java
...cloud/book/applet/dao/impl/AppletNewsCategoryDaoImpl.java
+35
-0
AppletNewsCategoryDTO.java
...ava/com/pcloud/book/applet/dto/AppletNewsCategoryDTO.java
+37
-0
AppletNewsDTO.java
...c/main/java/com/pcloud/book/applet/dto/AppletNewsDTO.java
+9
-0
AppletNews.java
...c/main/java/com/pcloud/book/applet/entity/AppletNews.java
+3
-0
AppletNewsCategory.java
...ava/com/pcloud/book/applet/entity/AppletNewsCategory.java
+30
-0
AppletHomeFacade.java
.../java/com/pcloud/book/applet/facade/AppletHomeFacade.java
+9
-0
AppletNewsClassifyVO.java
.../java/com/pcloud/book/applet/vo/AppletNewsClassifyVO.java
+5
-0
RightsSettingBizImpl.java
...oud/book/rightsSetting/biz/impl/RightsSettingBizImpl.java
+11
-7
AppletNews.xml
...vice-book/src/main/resources/mapper/applet/AppletNews.xml
+57
-52
AppletNewsCategory.xml
...k/src/main/resources/mapper/applet/AppletNewsCategory.xml
+85
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/applet/biz/AppletNewsBiz.java
View file @
5794ca48
...
...
@@ -23,6 +23,13 @@ import java.util.Map;
public
interface
AppletNewsBiz
{
/**
* 删除咨询标签
* @param id 咨询标签唯一标识
* @return
*/
void
deleteCategoryById
(
Long
id
);
/**
* 新增资讯分类
* @param appletNewsClassify
* @return
...
...
pcloud-service-book/src/main/java/com/pcloud/book/applet/biz/impl/AppletNewsBizImpl.java
View file @
5794ca48
...
...
@@ -8,11 +8,13 @@ import com.pcloud.book.applet.biz.AppletUserBookcaseBiz;
import
com.pcloud.book.applet.contants.AppletConstants
;
import
com.pcloud.book.applet.dao.AppletBusinessCardDao
;
import
com.pcloud.book.applet.dao.AppletLinkClickDao
;
import
com.pcloud.book.applet.dao.AppletNewsCategoryDao
;
import
com.pcloud.book.applet.dao.AppletNewsClassifyDao
;
import
com.pcloud.book.applet.dao.AppletNewsCommentDao
;
import
com.pcloud.book.applet.dao.AppletNewsDao
;
import
com.pcloud.book.applet.dao.AppletNewsServeDao
;
import
com.pcloud.book.applet.dao.AppletUserBookcaseDao
;
import
com.pcloud.book.applet.dto.AppletNewsCategoryDTO
;
import
com.pcloud.book.applet.dto.AppletNewsClassifyDTO
;
import
com.pcloud.book.applet.dto.AppletNewsCommentDTO
;
import
com.pcloud.book.applet.dto.AppletNewsCustomTagDTO
;
...
...
@@ -23,6 +25,7 @@ import com.pcloud.book.applet.dto.PvuvDTO;
import
com.pcloud.book.applet.entity.AppletBusinessCard
;
import
com.pcloud.book.applet.entity.AppletLinkClick
;
import
com.pcloud.book.applet.entity.AppletNews
;
import
com.pcloud.book.applet.entity.AppletNewsCategory
;
import
com.pcloud.book.applet.entity.AppletNewsClassify
;
import
com.pcloud.book.applet.entity.AppletNewsClassifyUser
;
import
com.pcloud.book.applet.entity.AppletNewsComment
;
...
...
@@ -61,6 +64,7 @@ import org.springframework.transaction.annotation.Transactional;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.HashMap
;
import
java.util.Iterator
;
...
...
@@ -103,6 +107,13 @@ public class AppletNewsBizImpl implements AppletNewsBiz {
private
AppletUserBookcaseDao
appletUserBookcaseDao
;
@Autowired
private
AppletBusinessCardDao
appletBusinessCardDao
;
@Autowired
private
AppletNewsCategoryDao
appletNewsCategoryDao
;
@Override
public
void
deleteCategoryById
(
Long
id
)
{
appletNewsCategoryDao
.
deleteById
(
id
);
}
@Override
public
Long
addAppletNewsClassify
(
AppletNewsClassify
appletNewsClassify
)
{
...
...
@@ -157,14 +168,31 @@ public class AppletNewsBizImpl implements AppletNewsBiz {
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"新增时栏目不能为空"
);
}
appletNews
.
setShowState
(
false
);
rightsSettingBiz
.
setClassifyAndLabel
(
appletNews
);
//
rightsSettingBiz.setClassifyAndLabel(appletNews);
appletNewsDao
.
insert
(
appletNews
);
//保存咨询类别
this
.
saveAppletNewsCategory
(
appletNews
.
getAppletNewsCategoryList
(),
appletNews
.
getId
());
// 保存选取的服务
this
.
saveAppletNewsServe
(
appletNews
.
getAppletNewsServeList
(),
appletNews
.
getId
());
this
.
updateSource
(
null
,
appletNews
.
getSource
());
return
appletNews
.
getId
();
}
private
void
saveAppletNewsCategory
(
List
<
AppletNewsCategory
>
categoryList
,
Long
newsId
)
{
if
(
ListUtils
.
isEmpty
(
categoryList
))
{
return
;
}
appletNewsCategoryDao
.
deletebyNewsId
(
newsId
);
for
(
AppletNewsCategory
category
:
categoryList
)
{
rightsSettingBiz
.
setClassifyAndLabel
(
category
);
category
.
setAppletNewId
(
newsId
);
}
appletNewsCategoryDao
.
batchCreate
(
categoryList
);
}
/**
* 保存选取的服务
* @param appletNewsServeList
...
...
@@ -231,7 +259,10 @@ public class AppletNewsBizImpl implements AppletNewsBiz {
rightsSettingBiz
.
setClassifyAndLabel
(
appletNews
);
appletNewsDao
.
update
(
appletNews
);
this
.
saveAppletNewsServe
(
appletNews
.
getAppletNewsServeList
(),
appletNews
.
getId
());
this
.
updateSource
(
beforeNews
.
getSource
(),
appletNews
.
getSource
());
this
.
updateSource
(
beforeNews
.
getSource
(),
appletNews
.
getSource
());
//保存咨询分类
this
.
saveAppletNewsCategory
(
appletNews
.
getAppletNewsCategoryList
(),
appletNews
.
getId
());
JedisClusterUtils
.
del
(
AppletConstants
.
HOME_NEWS_LIST
);
}
...
...
@@ -281,11 +312,14 @@ public class AppletNewsBizImpl implements AppletNewsBiz {
}
fillLabel
(
pageBeanNew
.
getRecordList
());
setLabelContent
(
pageBeanNew
.
getRecordList
());
//填充咨询分类
fillCategory
(
pageBeanNew
.
getRecordList
());
return
pageBeanNew
;
}
private
void
fillLabel
(
List
<
AppletNewsDTO
>
recordList
)
{
if
(
ListUtils
.
isEmpty
(
recordList
)){
if
(
ListUtils
.
isEmpty
(
recordList
))
{
return
;
}
List
<
Long
>
labelIds
=
new
ArrayList
<>();
...
...
@@ -505,13 +539,54 @@ public class AppletNewsBizImpl implements AppletNewsBiz {
this
.
fillBrowseCount
(
Lists
.
newArrayList
(
appletNewsDTO
));
fillLabel
(
Arrays
.
asList
(
appletNewsDTO
));
//填充类别集合
fillCategory
(
Arrays
.
asList
(
appletNewsDTO
));
fillBusinessCard
(
appletNewsDTO
);
return
appletNewsDTO
;
}
private
void
fillBusinessCard
(
AppletNewsDTO
appletNewsDTO
){
if
(
null
!=
appletNewsDTO
.
getBusinessCardId
()){
private
void
fillCategory
(
List
<
AppletNewsDTO
>
appletNewsDTOList
)
{
if
(
ListUtils
.
isEmpty
(
appletNewsDTOList
)){
return
;
}
for
(
AppletNewsDTO
newsDTO
:
appletNewsDTOList
)
{
Long
newsId
=
newsDTO
.
getId
();
List
<
AppletNewsCategoryDTO
>
newsCategoryDTOList
=
appletNewsCategoryDao
.
getByNewsId
(
newsId
);
if
(
ListUtils
.
isEmpty
(
newsCategoryDTOList
))
{
return
;
}
List
<
Long
>
firstClassifyIds
=
newsCategoryDTOList
.
stream
().
map
(
AppletNewsCategoryDTO:
:
getFirstClassify
)
.
collect
(
Collectors
.
toList
());
List
<
Long
>
secondClassifyIds
=
newsCategoryDTOList
.
stream
().
map
(
AppletNewsCategoryDTO:
:
getSecondClassify
)
.
collect
(
Collectors
.
toList
());
List
<
Long
>
classifyIds
=
firstClassifyIds
;
classifyIds
.
addAll
(
secondClassifyIds
);
classifyIds
.
removeAll
(
Collections
.
singleton
(
null
));
Map
<
Long
,
AssistTempletDTO
>
classifyMap
=
assistTempletConsr
.
mapByIds4Classify
(
classifyIds
);
for
(
AppletNewsCategoryDTO
categoryDTO
:
newsCategoryDTOList
)
{
AssistTempletDTO
templetDTO
=
classifyMap
.
get
(
categoryDTO
.
getFirstClassify
());
if
(
templetDTO
!=
null
)
{
categoryDTO
.
setFirstClassifyName
(
templetDTO
.
getTempletName
());
}
templetDTO
=
classifyMap
.
get
(
categoryDTO
.
getSecondClassify
());
if
(
templetDTO
!=
null
)
{
categoryDTO
.
setSecondClassifyName
(
templetDTO
.
getTempletName
());
}
}
newsDTO
.
setCategoryList
(
newsCategoryDTOList
);
}
}
private
void
fillBusinessCard
(
AppletNewsDTO
appletNewsDTO
)
{
if
(
null
!=
appletNewsDTO
.
getBusinessCardId
())
{
AppletBusinessCard
appletBusinessCard
=
appletBusinessCardDao
.
getById
(
appletNewsDTO
.
getBusinessCardId
());
if
(
appletBusinessCard
==
null
){
appletNewsDTO
.
setBusinessCardId
(
null
);
...
...
@@ -611,10 +686,15 @@ public class AppletNewsBizImpl implements AppletNewsBiz {
if
(
appletNewsClassifyVO
==
null
||
ListUtils
.
isEmpty
(
appletNewsClassifyVO
.
getAppletNewsIds
())){
throw
new
BizException
(
BizException
.
PARAM_IS_NULL
.
getCode
(),
"参数为空"
);
}
if
(!
NumberUtil
.
isNumber
(
appletNewsClassifyVO
.
getFirstClassify
())
)
{
throw
new
BizException
(
BizException
.
PARAM_IS_NULL
.
getCode
(),
"请选择
一级
分类"
);
if
(
ListUtils
.
isEmpty
(
appletNewsClassifyVO
.
getCategoryDTOList
()))
{
throw
new
BizException
(
BizException
.
PARAM_IS_NULL
.
getCode
(),
"请选择分类"
);
}
rightsSettingBiz
.
setClassifyAndLabel
(
appletNewsClassifyVO
);
for
(
Long
id
:
appletNewsClassifyVO
.
getAppletNewsIds
()){
this
.
saveAppletNewsCategory
(
appletNewsClassifyVO
.
getCategoryDTOList
(),
id
);
}
appletNewsDao
.
batchUpdateClassify
(
appletNewsClassifyVO
);
}
...
...
@@ -734,10 +814,13 @@ public class AppletNewsBizImpl implements AppletNewsBiz {
paramMap
.
put
(
"source"
,
source
);
PageBeanNew
<
AppletNewsDTO
>
pageBeanNew
=
appletNewsDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
)
,
paramMap
,
"listAppletNews4Analysis"
);
if
(
null
==
pageBeanNew
||
ListUtils
.
isEmpty
(
pageBeanNew
.
getRecordList
())){
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
0
,
new
ArrayList
<>());
new
PageParam
(
currentPage
,
numPerPage
),
paramMap
,
"listAppletNews4Analysis"
);
if
(
null
==
pageBeanNew
||
ListUtils
.
isEmpty
(
pageBeanNew
.
getRecordList
()))
{
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
0
,
new
ArrayList
<>());
}
fillCategory
(
pageBeanNew
.
getRecordList
());
//填充咨询适用类别
setLabelContent
(
pageBeanNew
.
getRecordList
());
fillStatistic
(
pageBeanNew
.
getRecordList
(),
browseQty
,
clickQty
);
return
pageBeanNew
;
...
...
pcloud-service-book/src/main/java/com/pcloud/book/applet/dao/AppletNewsCategoryDao.java
0 → 100644
View file @
5794ca48
package
com
.
pcloud
.
book
.
applet
.
dao
;
import
java.util.List
;
import
com.pcloud.book.applet.dto.AppletNewsCategoryDTO
;
import
com.pcloud.book.applet.dto.AppletNewsClassifyDTO
;
import
com.pcloud.book.applet.entity.AppletNewsCategory
;
import
com.pcloud.book.applet.entity.AppletNewsClassify
;
import
com.pcloud.book.applet.entity.AppletNewsClassifyUser
;
import
com.pcloud.common.core.dao.BaseDao
;
public
interface
AppletNewsCategoryDao
extends
BaseDao
<
AppletNewsCategory
>
{
void
batchCreate
(
List
<
AppletNewsCategory
>
categoryList
);
void
deletebyNewsId
(
Long
appletNewsId
);
List
<
AppletNewsCategoryDTO
>
getByNewsId
(
Long
appletNewsId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/applet/dao/impl/AppletNewsCategoryDaoImpl.java
0 → 100644
View file @
5794ca48
package
com
.
pcloud
.
book
.
applet
.
dao
.
impl
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.stereotype.Component
;
import
com.pcloud.book.applet.dao.AppletNewsCategoryDao
;
import
com.pcloud.book.applet.dao.AppletNewsClassifyDao
;
import
com.pcloud.book.applet.dto.AppletNewsCategoryDTO
;
import
com.pcloud.book.applet.dto.AppletNewsClassifyDTO
;
import
com.pcloud.book.applet.entity.AppletNewsCategory
;
import
com.pcloud.book.applet.entity.AppletNewsClassify
;
import
com.pcloud.book.applet.entity.AppletNewsClassifyUser
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
@Component
public
class
AppletNewsCategoryDaoImpl
extends
BaseDaoImpl
<
AppletNewsCategory
>
implements
AppletNewsCategoryDao
{
@Override
public
void
batchCreate
(
List
<
AppletNewsCategory
>
categoryList
)
{
getSessionTemplate
().
insert
(
getStatement
(
"batchCreate"
),
categoryList
);
}
@Override
public
void
deletebyNewsId
(
Long
appletNewsId
)
{
getSessionTemplate
().
delete
(
getStatement
(
"deletebyNewsId"
),
appletNewsId
);
}
@Override
public
List
<
AppletNewsCategoryDTO
>
getByNewsId
(
Long
appletNewsId
)
{
return
getSessionTemplate
().
selectList
(
getStatement
(
"getByNewsId"
),
appletNewsId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/applet/dto/AppletNewsCategoryDTO.java
0 → 100644
View file @
5794ca48
package
com
.
pcloud
.
book
.
applet
.
dto
;
import
java.util.Date
;
import
java.util.List
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.pcloud.common.dto.BaseDto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
@EqualsAndHashCode
(
callSuper
=
true
)
@Data
@ApiModel
(
"小程序资讯类别"
)
public
class
AppletNewsCategoryDTO
extends
BaseDto
{
@ApiModelProperty
(
"主键"
)
private
Long
id
;
@ApiModelProperty
(
"第一级类型标识"
)
private
Long
firstClassify
;
private
String
firstClassifyName
;
@ApiModelProperty
(
"第二级类型标识"
)
private
Long
secondClassify
;
private
String
secondClassifyName
;
@ApiModelProperty
(
"年级标签id"
)
private
Long
gradeLabelId
;
private
String
gradeLabelName
;
@ApiModelProperty
(
"科目标签id"
)
private
Long
subjectLabelId
;
private
String
subjectLabelName
;
}
pcloud-service-book/src/main/java/com/pcloud/book/applet/dto/AppletNewsDTO.java
View file @
5794ca48
...
...
@@ -57,6 +57,12 @@ public class AppletNewsDTO extends BaseDto {
)
protected
Date
createTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
protected
Date
updateTime
;
@ApiModelProperty
(
"第一级类型标识"
)
private
Long
firstClassify
;
@ApiModelProperty
(
"第二级类型标识"
)
...
...
@@ -123,4 +129,7 @@ public class AppletNewsDTO extends BaseDto {
@ApiModelProperty
(
"点击量pv"
)
private
Integer
clickCount
;
@ApiModelProperty
(
"类别"
)
private
List
<
AppletNewsCategoryDTO
>
categoryList
;
}
pcloud-service-book/src/main/java/com/pcloud/book/applet/entity/AppletNews.java
View file @
5794ca48
...
...
@@ -101,4 +101,7 @@ public class AppletNews extends BaseTempletClassify {
@ApiModelProperty
(
"选取的服务"
)
List
<
AppletNewsServe
>
appletNewsServeList
;
@ApiModelProperty
(
"咨询类别"
)
List
<
AppletNewsCategory
>
appletNewsCategoryList
;
}
pcloud-service-book/src/main/java/com/pcloud/book/applet/entity/AppletNewsCategory.java
0 → 100644
View file @
5794ca48
package
com
.
pcloud
.
book
.
applet
.
entity
;
import
javax.validation.constraints.NotNull
;
import
java.util.Date
;
import
java.util.List
;
import
org.hibernate.validator.constraints.Length
;
import
com.pcloud.book.rightsSetting.entity.BaseTempletClassify
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
"小程序资讯类别"
)
public
class
AppletNewsCategory
extends
BaseTempletClassify
{
@ApiModelProperty
(
"主键"
)
private
Long
id
;
@ApiModelProperty
(
"咨询标签"
)
private
Long
appletNewId
;
@ApiModelProperty
(
"创建人"
)
private
Long
creator
;
@ApiModelProperty
(
"创建时间"
)
private
Date
createTime
;
}
pcloud-service-book/src/main/java/com/pcloud/book/applet/facade/AppletHomeFacade.java
View file @
5794ca48
...
...
@@ -99,6 +99,15 @@ public class AppletHomeFacade {
}
@ApiOperation
(
"删除咨询标签"
)
@PostMapping
(
"deleteCategoryById"
)
public
ResponseDto
<?>
deleteCategoryById
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
"id"
)
@ApiParam
(
"咨询id"
)
Long
id
)
{
SessionUtil
.
getInfoToken4Redis
(
token
);
appletNewsBiz
.
deleteCategoryById
(
id
);
return
new
ResponseDto
<>();
}
@ApiOperation
(
"新增书单栏目"
)
@PostMapping
(
"addBooklistClassify"
)
public
ResponseDto
<
Long
>
addBooklistClassify
(
...
...
pcloud-service-book/src/main/java/com/pcloud/book/applet/vo/AppletNewsClassifyVO.java
View file @
5794ca48
package
com
.
pcloud
.
book
.
applet
.
vo
;
import
com.pcloud.book.applet.dto.AppletNewsCategoryDTO
;
import
com.pcloud.book.applet.entity.AppletNewsCategory
;
import
com.pcloud.book.rightsSetting.entity.BaseTempletClassify
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serializable
;
...
...
@@ -25,4 +27,7 @@ public class AppletNewsClassifyVO extends BaseTempletClassify {
@ApiModelProperty
(
"资讯栏目id"
)
private
Long
newsClassifyId
;
@ApiModelProperty
(
"分类集合"
)
private
List
<
AppletNewsCategory
>
categoryDTOList
;
}
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/biz/impl/RightsSettingBizImpl.java
View file @
5794ca48
...
...
@@ -1710,7 +1710,8 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
}
// 填充群
List
<
RightsNowItem
>
items
=
new
ArrayList
<>();
List
<
GroupActivity4AppletDTO
>
collageList
=
supplementGroup
(
rightsSettingId
,
wechatUserId
,
rightsSettingItem
.
getRightsClassifyId
(),
top
,
items
,
bookId
,
rightsType
);
List
<
GroupActivity4AppletDTO
>
collageList
=
supplementGroup
(
rightsSettingId
,
wechatUserId
,
rightsSettingItem
.
getRightsClassifyId
(),
top
,
items
,
bookId
,
rightsType
,
readType
);
if
(!
ListUtils
.
isEmpty
(
collageList
)){
for
(
GroupActivity4AppletDTO
item
:
collageList
){
rightsSettingItem
.
getGroupActivity4AppletList
().
add
(
item
);
...
...
@@ -1978,7 +1979,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
rightsSetting
.
setGroupServiceTitle
(
rightsSettingTitle
);
}
else
{
processNowItems4Group
(
rightsSettingTitle
,
nowItems
,
RightsNowItemTypeNew
.
GROUP_SERVICE
,
rightsSetting
.
getId
(),
wechatUserId
,
Long
.
valueOf
(
RightsNowItemTypeNew
.
GROUP_SERVICE
.
value
),
BookConstant
.
MAX_NEWS_COUNT_GROUP
,
bookId
);
Long
.
valueOf
(
RightsNowItemTypeNew
.
GROUP_SERVICE
.
value
),
BookConstant
.
MAX_NEWS_COUNT_GROUP
,
bookId
,
readType
);
rightsSetting
.
setGroupServiceTitle
(
rightsSettingTitle
);
}
...
...
@@ -1988,7 +1989,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
private
void
processNowItems4Group
(
RightsSettingTitle
rightsSettingTitle
,
List
<
RightsNowItem
>
nowItems
,
RightsNowItemTypeNew
itemType
,
Long
rightsSettingId
,
Long
wechatUserId
,
Long
rightsClassifyId
,
Integer
top
,
Long
bookId
)
{
Integer
top
,
Long
bookId
,
Integer
readType
)
{
if
(
null
==
rightsSettingTitle
||
null
==
rightsSettingTitle
.
getRightsSettingId
())
{
return
;
}
...
...
@@ -1998,7 +1999,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
if
(
CollectionUtils
.
isEmpty
(
nowItems
)
&&
rightsSettingTitle
.
getCollageState
()!=
null
&&
rightsSettingTitle
.
getCollageState
().
intValue
()
==
collage
.
intValue
())
{
// 填充群
supplementGroup
(
rightsSettingId
,
wechatUserId
,
rightsClassifyId
,
top
,
items
,
bookId
,
null
);
supplementGroup
(
rightsSettingId
,
wechatUserId
,
rightsClassifyId
,
top
,
items
,
bookId
,
null
,
readType
);
// 处理权益中的应用/作品
fillProductAndApp
(
items
);
rightsSettingTitle
.
setRightsSettingItemList
(
items
);
...
...
@@ -2017,14 +2018,16 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
if
(
items
.
size
()
<
top
&&
rightsSettingTitle
.
getCollageState
()!=
null
&&
rightsSettingTitle
.
getCollageState
().
intValue
()
==
collage
.
intValue
())
{
// 填充咨询
supplementGroup
(
rightsSettingId
,
wechatUserId
,
rightsClassifyId
,
top
,
items
,
bookId
,
null
);
supplementGroup
(
rightsSettingId
,
wechatUserId
,
rightsClassifyId
,
top
,
items
,
bookId
,
null
,
readType
);
}
// 处理权益中的应用/作品
fillProductAndApp
(
items
);
rightsSettingTitle
.
setRightsSettingItemList
(
items
);
}
private
List
<
GroupActivity4AppletDTO
>
supplementGroup
(
Long
rightsSettingId
,
Long
wechatUserId
,
Long
rightsClassifyId
,
Integer
top
,
List
<
RightsNowItem
>
items
,
Long
bookId
,
String
rightsType
)
{
private
List
<
GroupActivity4AppletDTO
>
supplementGroup
(
Long
rightsSettingId
,
Long
wechatUserId
,
Long
rightsClassifyId
,
Integer
top
,
List
<
RightsNowItem
>
items
,
Long
bookId
,
String
rightsType
,
Integer
readType
)
{
// 书刊分类
List
<
GroupActivity4AppletDTO
>
groupActivity4AppletDTOList
=
null
;
BookAdviserDto
bookAdviserDto
=
bookAdviserBiz
.
getOneMainBook
(
bookId
);
...
...
@@ -2062,7 +2065,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
}
}
}
else
{
//立享权益
RightsSettingTitle
rightsSettingTitle
=
rightsSettingTitleMapper
.
getByRightSettingIdAndType
(
rightsSettingId
,
6
,
null
);
RightsSettingTitle
rightsSettingTitle
=
rightsSettingTitleMapper
.
getByRightSettingIdAndType
(
rightsSettingId
,
RightsNowItemTypeNew
.
GROUP_SERVICE
.
value
,
readType
);
// List<RightsSettingTitle> rightsSettingTitles = rightsSettingTitleMapper.getByRightSettingId(rightsSettingId, null);
// Iterator<RightsSettingTitle> it = rightsSettingTitles.iterator();
// while(it.hasNext()){
...
...
@@ -2604,6 +2607,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
map
.
put
(
"rightsType"
,
null
);
page
=
appletNewsDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
map
,
"getPageByNewsByTempletLabel"
);
if
(
Objects
.
nonNull
(
page
)
&&
CollUtil
.
isNotEmpty
(
page
.
getRecordList
()))
{
appletNewsDTOS
=
page
;
}
}
...
...
pcloud-service-book/src/main/resources/mapper/applet/AppletNews.xml
View file @
5794ca48
...
...
@@ -34,10 +34,10 @@
<result
column=
"business_card_isOpen"
property=
"businessCardIsOpen"
jdbcType=
"TINYINT"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, news_name, source, news_classify_id, pro_label_id, dep_label_id, pur_label_id, type,
digest,
pic1, pic2, pic3,
content, show_state, create_time, update_time, first_classify, second_classify, grade_label_id, subject_label_id,
rights_classify_id,
jump_type, jump_url, url_number, custom_tag_id, show_source, show_link,business_card_id,business_card_type,
business_card_isOpen
<sql
id=
"Base_Column_List"
>
news.id, news.news_name, news.source, news.news_classify_id, news.pro_label_id, news.dep_label_id, news.pur_label_id, news.type, news.
digest,
pic1, pic2, pic3,
news.content, show_state, news.create_time, news.update_time, news.first_classify, news.second_classify, news.grade_label_id, news.subject_label_id, news.
rights_classify_id,
news.jump_type, news.jump_url, news.url_number, news.custom_tag_id, news.show_source, news.show_link,news.business_card_id,news.business_card_type,news.
business_card_isOpen
</sql>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.applet.entity.AppletNews"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
...
...
@@ -106,20 +106,22 @@
<update
id=
"updateNewsShowState"
parameterType=
"com.pcloud.book.applet.entity.AppletNews"
>
update applet_news
set show_state = #{showState,jdbcType=BOOLEAN}
set show_state = #{showState,jdbcType=BOOLEAN},
update_time=NOW()
where id = #{id,jdbcType=BIGINT}
</update>
<update
id=
"updateCardShowState"
parameterType=
"com.pcloud.book.applet.entity.AppletNews"
>
update applet_news
set business_card_isOpen = #{businessCardIsOpen,jdbcType=TINYINT}
set business_card_isOpen = #{businessCardIsOpen,jdbcType=TINYINT},
update_time=NOW()
where id = #{id,jdbcType=BIGINT}
</update>
<select
id=
"getById"
parameterType=
"long"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from applet_news
where id=#{id}
from applet_news
news
where
news.
id=#{id}
</select>
<delete
id=
"deleteById"
parameterType=
"long"
>
...
...
@@ -128,7 +130,7 @@
</delete>
<select
id=
"listAppletNews"
parameterType=
"map"
resultType=
"com.pcloud.book.applet.dto.AppletNewsDTO"
>
SELECT
SELECT
DISTINCT
n.id,
n.news_name newsName,
n.source,
...
...
@@ -145,6 +147,7 @@
n.show_state showState,
c.news_classify newsClassify,
n.create_time createTime,
n.update_time updateTime,
n.first_classify firstClassify,
n.second_classify secondClassify,
n.grade_label_id gradeLabelId,
...
...
@@ -163,6 +166,7 @@
LEFT JOIN applet_news_classify c ON n.news_classify_id=c.id
LEFT JOIN rights_setting_classify d ON n.rights_classify_id = d.id
LEFT JOIN applet_news_custom_tag t ON n.custom_tag_id = t.id
LEFT JOIN applet_news_category category on n.id = category.applet_news_id
WHERE 1=1
<if
test=
"name != null"
>
AND (n.news_name LIKE CONCAT("%",#{name},"%") OR n.url_number LIKE CONCAT("%",#{name},"%"))
...
...
@@ -174,16 +178,16 @@
AND n.show_state = #{showState}
</if>
<if
test=
"firstClassify!=null"
>
AND
n
.first_classify =#{firstClassify}
AND
category
.first_classify =#{firstClassify}
</if>
<if
test=
"secondClassify!=null"
>
AND
n
.second_classify =#{secondClassify}
AND
category
.second_classify =#{secondClassify}
</if>
<if
test=
"gradeLabelId != null"
>
AND
n
.grade_label_id = #{gradeLabelId}
AND
category
.grade_label_id = #{gradeLabelId}
</if>
<if
test=
"subjectLabelId != null"
>
AND
n
.subject_label_id = #{subjectLabelId}
AND
category
.subject_label_id = #{subjectLabelId}
</if>
<if
test=
"rightsClassifyId!=null"
>
AND n.rights_classify_id =#{rightsClassifyId}
...
...
@@ -194,7 +198,7 @@
<if
test=
"customTagId != null"
>
AND n.custom_tag_id = #{customTagId}
</if>
ORDER BY n.
cre
ate_time DESC
ORDER BY n.
upd
ate_time DESC
</select>
<select
id=
"getCountByBusinessCardId"
parameterType=
"long"
resultType=
"long"
>
...
...
@@ -205,9 +209,10 @@
<select
id=
"getByNewsClassifyId"
parameterType=
"long"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from applet_news
where news_classify_id=#{newsClassifyId}
select
<include
refid=
"Base_Column_List"
/>
from applet_news news
where news.news_classify_id=#{newsClassifyId}
</select>
<select
id=
"getByNewsByTempletLabel"
parameterType=
"map"
resultType=
"com.pcloud.book.applet.dto.AppletNewsDTO"
>
...
...
@@ -238,70 +243,68 @@
n.show_source showSource,
n.show_link showLink
FROM applet_news n
LEFT JOIN applet_news_category category on n.id = category.applet_news_id
WHERE 1=1
and n.show_state = 1
<if
test=
"firstClassify != null"
>
and n
.first_classify = #{firstClassify}
and category
.first_classify = #{firstClassify}
</if>
<if
test=
"secondClassify != null"
>
and n
.second_classify = #{secondClassify}
and category
.second_classify = #{secondClassify}
</if>
<if
test=
"gradeLabelId != null"
>
and n
.grade_label_id = #{gradeLabelId}
and category
.grade_label_id = #{gradeLabelId}
</if>
<if
test=
"subjectLabelId != null"
>
and n
.subject_label_id = #{subjectLabelId}
and category
.subject_label_id = #{subjectLabelId}
</if>
AND n.rights_classify_id IN(
SELECT id FROM rights_setting_classify WHERE 1=1
<if
test=
"rightsType != null"
>
<if
test=
"rightsType != null"
>
AND rights_type = #{rightsType}
</if>
)
ORDER BY n.cre
ate_time DESC
ORDER BY n.upd
ate_time DESC
</select>
<select
id=
"getByTempletAndClassify"
parameterType=
"map"
resultMap=
"BaseResultMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM
applet_news t
applet_news news
LEFT JOIN applet_news_category category on news.id = category.applet_news_id
WHERE
t
.show_state = 1
news
.show_state = 1
<if
test=
"firstClassify!=null"
>
AND t
.first_classify =#{firstClassify}
AND category
.first_classify =#{firstClassify}
</if>
<if
test=
"secondClassify!=null"
>
AND t
.second_classify =#{secondClassify}
AND category
.second_classify =#{secondClassify}
</if>
<if
test=
"gradeLabelId != null"
>
AND t
.grade_label_id = #{gradeLabelId}
AND category
.grade_label_id = #{gradeLabelId}
</if>
<if
test=
"subjectLabelId != null"
>
AND t
.subject_label_id = #{subjectLabelId}
AND category
.subject_label_id = #{subjectLabelId}
</if>
<if
test=
"rightsClassifyId!=null"
>
AND t
.rights_classify_id =#{rightsClassifyId}
AND news
.rights_classify_id =#{rightsClassifyId}
</if>
ORDER BY
t.cre
ate_time DESC
news.upd
ate_time DESC
LIMIT #{top}
</select>
<update
id=
"batchUpdateClassify"
parameterType=
"map"
>
UPDATE applet_news
SET
first_classify = #{firstClassify,jdbcType=BIGINT},
second_classify = #{secondClassify,jdbcType=BIGINT},
grade_label_id = #{gradeLabelId,jdbcType=BIGINT},
subject_label_id = #{subjectLabelId,jdbcType=BIGINT},
rights_classify_id = #{rightsClassifyId,jdbcType=BIGINT},
<if
test=
"newsClassifyId != null"
>
news_classify_id = #{newsClassifyId},
</if>
update_time=NOW()
WHERE id IN
<foreach
collection=
"ids"
item=
"item"
separator=
","
open=
"("
close=
")"
>
<foreach
collection=
"ids"
item=
"item"
separator=
","
open=
"("
close=
")"
>
${item}
</foreach>
</update>
...
...
@@ -380,7 +383,7 @@
</select>
<select
id=
"listAppletNews4Analysis"
parameterType=
"map"
resultType=
"com.pcloud.book.applet.dto.AppletNewsDTO"
>
SELE
CT
SELECT DISTIN
CT
n.id,
n.news_name newsName,
n.source,
...
...
@@ -411,21 +414,22 @@
FROM applet_news n
LEFT JOIN applet_news_classify c ON n.news_classify_id=c.id
LEFT JOIN rights_setting_classify d ON n.rights_classify_id = d.id
LEFT JOIN applet_news_category category on n.id = category.applet_news_id
WHERE 1=1
<if
test=
"name != null"
>
AND (n.news_name LIKE CONCAT("%",#{name},"%") or n.url_number LIKE CONCAT("%",#{name},"%"))
</if>
<if
test=
"firstClassify!=null"
>
AND n
.first_classify =#{firstClassify}
AND category
.first_classify =#{firstClassify}
</if>
<if
test=
"secondClassify!=null"
>
AND n
.second_classify =#{secondClassify}
AND category
.second_classify =#{secondClassify}
</if>
<if
test=
"gradeLabelId != null"
>
AND n
.grade_label_id = #{gradeLabelId}
AND category
.grade_label_id = #{gradeLabelId}
</if>
<if
test=
"subjectLabelId != null"
>
AND n
.subject_label_id = #{subjectLabelId}
AND category
.subject_label_id = #{subjectLabelId}
</if>
<if
test=
"linkOnly == 1"
>
and n.jump_type = 2
...
...
@@ -436,7 +440,7 @@
<if
test=
"source!=null"
>
AND n.source =#{source}
</if>
ORDER BY n.cre
ate_time DESC
ORDER BY n.upd
ate_time DESC
</select>
<select
id=
"getByIds"
resultType=
"com.pcloud.book.applet.dto.AppletNewsDTO"
>
...
...
@@ -471,7 +475,7 @@
<foreach
collection=
"list"
item=
"item"
separator=
","
open=
"("
close=
")"
>
${item}
</foreach>
ORDER BY n.
cre
ate_time DESC
ORDER BY n.
upd
ate_time DESC
</select>
...
...
@@ -525,7 +529,7 @@
ORDER BY RAND()
</when>
<otherwise>
ORDER BY n.
cre
ate_time DESC
ORDER BY n.
upd
ate_time DESC
</otherwise>
</choose>
</select>
...
...
@@ -588,7 +592,7 @@
</select>
<select
id=
"getPageByNewsByTempletLabel"
parameterType=
"map"
resultType=
"com.pcloud.book.applet.dto.AppletNewsDTO"
>
SELE
CT
SELECT DISTIN
CT
n.id,
n.news_name newsName,
n.source,
...
...
@@ -615,27 +619,28 @@
n.show_source showSource,
n.show_link showLink
FROM applet_news n
LEFT JOIN applet_news_category category on n.id = category.applet_news_id
WHERE 1=1
and n.show_state = 1
<if
test=
"firstClassify != null"
>
and n
.first_classify = #{firstClassify}
and category
.first_classify = #{firstClassify}
</if>
<if
test=
"secondClassify != null"
>
and n
.second_classify = #{secondClassify}
and category
.second_classify = #{secondClassify}
</if>
<if
test=
"gradeLabelId != null"
>
and n
.grade_label_id = #{gradeLabelId}
and category
.grade_label_id = #{gradeLabelId}
</if>
<if
test=
"subjectLabelId != null"
>
and n
.subject_label_id = #{subjectLabelId}
and category
.subject_label_id = #{subjectLabelId}
</if>
AND n.rights_classify_id IN(
SELECT id FROM rights_setting_classify WHERE 1=1
<if
test=
"rightsType != null"
>
<if
test=
"rightsType != null"
>
AND rights_type = #{rightsType}
</if>
)
ORDER BY n.cre
ate_time DESC
ORDER BY n.upd
ate_time DESC
</select>
<select
id=
"getClassifyNewsByTempletLabel"
parameterType=
"map"
resultType=
"com.pcloud.book.applet.dto.AppletNewsDTO"
>
...
...
@@ -693,7 +698,7 @@
<if
test=
"efficientRead!=null"
>
AND i.efficient_read = #{efficientRead}
</if>
ORDER BY n.
cre
ate_time DESC
ORDER BY n.
upd
ate_time DESC
</select>
<insert
id=
"batchInsert"
parameterType=
"com.pcloud.book.applet.entity.AppletNews"
useGeneratedKeys=
"true"
...
...
pcloud-service-book/src/main/resources/mapper/applet/AppletNewsCategory.xml
0 → 100644
View file @
5794ca48
<?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.applet.dao.impl.AppletNewsCategoryDaoImpl"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.applet.entity.AppletNewsCategory"
>
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"applet_news_id"
property=
"appletNewId"
jdbcType=
"BIGINT"
/>
<result
column=
"creator"
property=
"creator"
jdbcType=
"BIGINT"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<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"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, applet_news_id, creator, create_time, first_classify,second_classify, grade_label_id, subject_label_id
</sql>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.applet.entity.AppletNewsCategory"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into applet_news_category (
applet_news_id, creator, create_time, first_classify,second_classify, grade_label_id, subject_label_id
)
values (
#{appletNewId}, #{creator}, NOW(), #{firstClassify}, #{secondClassify}, #{gradeLabelId}, #{subjectLabelId}
)
</insert>
<insert
id=
"batchCreate"
parameterType=
"list"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
insert into applet_news_category (
applet_news_id, creator, create_time, first_classify,second_classify, grade_label_id, subject_label_id)
values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
( #{item.appletNewId}, #{item.creator}, NOW(), #{item.firstClassify}, #{item.secondClassify},
#{item.gradeLabelId}, #{item.subjectLabelId} )
</foreach>
</insert>
<update
id=
"update"
parameterType=
"com.pcloud.book.applet.entity.AppletNewsCategory"
>
update applet_news_category
<set>
<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>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<select
id=
"getByNewsId"
parameterType=
"long"
resultType=
"com.pcloud.book.applet.dto.AppletNewsCategoryDTO"
>
select
category.id,
category.applet_news_id,
category.first_classify firstClassify,
category.second_classify secondClassify,
category.grade_label_id gradeLabelId,
category.subject_label_id subjectLabelId,
label.name gradeLabelName,
label2.name subjectLabelName
from applet_news_category category
LEFT JOIN book_label label ON category.grade_label_id = label.id
LEFT JOIN book_label label2 ON category.subject_label_id = label2.id
where applet_news_id=#{appletNewId}
</select>
<delete
id=
"deleteById"
parameterType=
"long"
>
delete from applet_news_category
where id=#{id}
</delete>
<delete
id=
"deletebyNewsId"
parameterType=
"long"
>
DELETE FROM applet_news_category
WHERE applet_news_id = #{appletNewId}
</delete>
</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